Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions docs/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <a>. 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
Expand Down
49 changes: 49 additions & 0 deletions docs/_includes/components/footer.html
Original file line number Diff line number Diff line change
@@ -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" <p> 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 <a> 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 %}
<hr>
<footer>
{% if site.back_to_top %}
<p><a href="#top" id="back-to-top">{{ site.back_to_top_text }}</a></p>
{% endif %}

{{ footer_custom }}

{% if site.last_edit_timestamp or site.gh_edit_link or site.gh_offline_link %}
<div class="d-flex mt-2">
{% if site.last_edit_timestamp and site.last_edit_time_format and page.last_modified_date %}
<p class="text-small text-grey-dk-000 mb-0 mr-2">
Page last modified: <span class="d-inline-block">{{ page.last_modified_date | date: site.last_edit_time_format }}</span>.
</p>
{% endif %}
{% if
site.gh_edit_link and
site.gh_edit_link_text and
site.gh_edit_repository and
site.gh_edit_branch and
site.gh_edit_view_mode
%}
<p class="text-small text-grey-dk-000 mb-0{% if site.gh_offline_link and site.gh_offline_link_text and site.gh_offline_link_url %} mr-2{% endif %}">
<a href="{{ site.gh_edit_repository }}/{{ site.gh_edit_view_mode }}/{{ site.gh_edit_branch }}{% if site.gh_edit_source %}/{{ site.gh_edit_source }}{% endif %}{% if page.collection and site.collections_dir %}/{{ site.collections_dir }}{% endif %}/{{ page.path }}" id="edit-this-page">{{ site.gh_edit_link_text }}</a>
</p>
{% endif %}
{% if site.gh_offline_link and site.gh_offline_link_text and site.gh_offline_link_url %}
<p class="text-small text-grey-dk-000 mb-0">
<a href="{{ site.gh_offline_link_url }}" id="download-offline">{{ site.gh_offline_link_text }}</a>
</p>
{% endif %}
</div>
{% endif %}
</footer>
{% endif %}
Loading