diff --git a/ci/deploy-gh-pages.sh b/ci/deploy-gh-pages.sh index 76946838863..812aba20a43 100755 --- a/ci/deploy-gh-pages.sh +++ b/ci/deploy-gh-pages.sh @@ -38,6 +38,11 @@ echo -e "\nRemoving old files from previous builds of ${version}:" rm -rvf ${version} echo -e "\nCopying HTML files to ${version}:" cp -Rvf ../build/doc/rst/html/ ${version}/ +# Make a ZIP file for the HTML documentation +cd ${version} +zip -r ../gmt-docs-${version}.zip * +mv ../gmt-docs-${version}.zip . +cd .. # If this is a new release, update the link from /latest to it if [[ "${version}" != "dev" ]]; then echo -e "\nSetup link from ${version} to 'latest'." diff --git a/doc/rst/conf.py.in b/doc/rst/conf.py.in index a95650abc0b..953391b4259 100644 --- a/doc/rst/conf.py.in +++ b/doc/rst/conf.py.in @@ -34,6 +34,10 @@ copyright = "@GMT_VERSION_YEAR@, The GMT Team" version = '@GMT_PACKAGE_VERSION_MAJOR@.@GMT_PACKAGE_VERSION_MINOR@' # The full version shown in the page title release = '@GMT_PACKAGE_VERSION@' +if len('@GMT_PACKAGE_VERSION_WITH_GIT_REVISION@'.split("_")) == 3: + doc_version = "dev" +else: + doc_version = version # -- Options for HTML output --------------------------------------------------- html_theme = 'rtd' @@ -60,6 +64,10 @@ html_context = { ' Source Code', "https://github.com/GenericMappingTools/gmt", ), + ( + ' Download HTML zip', + f"/{doc_version}/gmt-docs-{doc_version}.zip", + ), ], # Show the "Edit on Github" link # https://docs.readthedocs.io/en/latest/guides/vcs.html