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

@@ -1,3 +1,4 @@
{% set separator = config.extra.separator | default(value="•") %}
<footer>
<section>
<nav class="socials nav-navs">
@@ -49,7 +50,35 @@
{% endif %}
</nav>
<div class="credits">
<small>{%- if lang != config.default_language %} {{ trans(key="powered_by" | safe, lang=lang) }} {% else %} Powered by {% endif %} <a href="https://www.getzola.org" target="_blank">Zola</a> {%- if lang != config.default_language %} {{ trans(key="and" | safe, lang=lang) }} {% else %} & {% endif %} <a href="https://github.com/welpo/tabi" target="_blank">tabi</a></small>
{# Shows "Powered by Zola & tabi" #}
{# Shows link to remote repository if repository is set and `show_remote_source` is not false #}
{% set show_source = config.extra.show_remote_source | default(value=true) %}
<small>
{%- if lang != config.default_language -%}
{{ trans(key="powered_by" | safe, lang=lang) }}
{%- else -%}
Powered by
{%- endif -%}
&nbsp;<a href="https://www.getzola.org" target="_blank">Zola</a>&nbsp;
{%- if lang != config.default_language -%}
{{ trans(key="and" | safe, lang=lang) }}
{%- else -%}
&
{%- endif -%}
&nbsp;<a href="https://github.com/welpo/tabi" target="_blank">tabi</a>
{%- if config.extra.remote_repository_url and show_source -%}
&nbsp;{{ separator }}
<a href="{{ config.extra.remote_repository_url }}" target="_blank">
{%- if lang != config.default_language -%}
{{ trans(key="site_source" | safe, lang=lang) }}
{%- else -%}
Site source
{%- endif -%}
</a>
{%- endif -%}
</small>
</div>
</section>