feat(footer): add configurable copyright notice (#112)

This commit is contained in:
Óscar
2023-08-18 23:12:39 +02:00
committed by GitHub
parent 1601fbf30c
commit 5ae21b5335
4 changed files with 54 additions and 12 deletions

View File

@@ -50,17 +50,25 @@
{% endif %}
</nav>
<div class="credits">
{# 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>
{# Shows optional Copyright notice #}
{%- if config.extra.copyright -%}
{% set current_year = now() | date(format="%Y") %}
{# Translate the copyright if set in the config #}
{%- if config.extra.translate_copyright and lang != config.default_language -%}
<p>{{ trans(key="copyright", lang=lang) | replace(from="$CURRENT_YEAR", to=current_year) | markdown | safe }}</p>
{%- else -%}
<p>{{ config.extra.copyright | replace(from="$CURRENT_YEAR", to=current_year) | markdown | safe }}</p>
{%- endif -%}
{%- endif -%}
{# Shows "Powered by Zola & tabi" notice #}
{%- 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 -%}
@@ -68,6 +76,8 @@
{%- endif -%}
&nbsp;<a href="https://github.com/welpo/tabi" target="_blank">tabi</a>
{# 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) %}
{%- if config.extra.remote_repository_url and show_source -%}
&nbsp;{{ separator }}
<a href="{{ config.extra.remote_repository_url }}" target="_blank">