feat(footer): add link to remote repository

Adds two options, both defaulting to true if the remote repo URL is set:
* `show_remote_changes`: links the commit history of a post next to the updated date. (#109)
* `show_remote_source`: links to the site's repository on the footer.
This commit is contained in:
welpo
2023-08-18 21:46:37 +02:00
parent 6dc6e51ea8
commit 99f6f2dcdc
4 changed files with 44 additions and 8 deletions

View File

@@ -32,7 +32,9 @@
{% if page.updated %}
</ul><ul class="meta last-updated"><li>{%- if lang != config.default_language %} {{ trans(key="last_updated_on" | safe, lang=lang) }} {% else %} Last updated on {% endif %} {{ macros_format_date::format_date(date=page.updated, short=true) }}</li>
{% if config.extra.remote_repository_url %}
{# Show link to remote changes if enabled #}
{% set show_remote_changes = config.extra.show_remote_changes | default(value=true) %}
{% if config.extra.remote_repository_url and show_remote_changes %}
<li>&nbsp;{{ separator }}&nbsp;<a href="{{ macros_create_history_url::create_history_url(relative_path=page.relative_path) }}" target="_blank" rel="noopener noreferrer">{%- if lang != config.default_language -%}{{ trans(key="see_changes" | safe, lang=lang) }}{% else %}See changes{%- endif -%}<small></small></a></li>
{% endif %}
{% endif %}