From cb7b5725738d5b9813812fbf78b2d5ba3da33b02 Mon Sep 17 00:00:00 2001 From: Kuba Sunderland-Ober Date: Sat, 16 May 2026 16:27:41 +0200 Subject: [PATCH] Add a download link to each page, next to the "Edit on GitHub" link. --- docs/_config.yml | 12 +++++++ docs/_includes/components/footer.html | 49 +++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 docs/_includes/components/footer.html diff --git a/docs/_config.yml b/docs/_config.yml index 06e9084..bf0e673 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -110,6 +110,18 @@ gh_edit_branch: "main" # the branch that your docs is served from gh_edit_source: docs # the source that your files originate from gh_edit_view_mode: "tree" # "tree" or "edit" if you want the user to jump into the editor immediately +# Footer "Download offline copy" link -- points at the offline-site +# zip attached to the latest GitHub release (cut by the manual +# `workflow_dispatch` path in .github/workflows/jekyll-gh-pages.yml). +# Rendered inside the same flex row as the "Edit this page" link, +# with id="download-offline" on the . Emitted in both the online +# _site/ and the offline _site-offline/ trees -- online readers use +# it to fetch the offline copy, offline readers use it to refresh +# theirs against the latest release. +gh_offline_link: true +gh_offline_link_text: "Download offline copy" +gh_offline_link_url: "https://github.com/twinbasic/documentation/releases/latest/download/twinbasic-docs-offline.zip" + # When true, the Offlinify plugin (_plugins/offlinify.rb) runs at the # end of the build, copies _site/ to _site-offline/, rewrites every # URL to a page-relative form, patches a couple of just-the-docs JS diff --git a/docs/_includes/components/footer.html b/docs/_includes/components/footer.html new file mode 100644 index 0000000..e6a5918 --- /dev/null +++ b/docs/_includes/components/footer.html @@ -0,0 +1,49 @@ +{%- comment -%} + Shadow of just-the-docs's _includes/components/footer.html, kept in + sync with the upstream 0.10.x layout. The only addition is the + "Download offline copy"

rendered inside the same flex row as + "Edit this page on GitHub", gated on `site.gh_offline_link` (set in + _config.yml). The link's carries id="download-offline" as a + stable hook, mirroring id="edit-this-page" next to it. Both the + online and offline trees render the link -- online users use it to + fetch the offline copy, offline users use it to refresh theirs. +{%- endcomment -%} +{% capture footer_custom %} + {%- include footer_custom.html -%} +{% endcapture %} +{% if footer_custom != "" or site.last_edit_timestamp or site.gh_edit_link or site.gh_offline_link or site.back_to_top %} +


+ +{% endif %}