Refactor footer content (#3041)

Refactor footer content into a reusable variable for cleaner code
This commit is contained in:
Nikos Kontogeorgis 2025-03-02 02:47:22 +02:00 committed by GitHub
parent 6625f2395a
commit 74beacb274
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,16 +1,20 @@
{% capture footer_contents %}
© Copyright {{ site.time | date: '%Y' }}
{{ site.first_name }}
{{ site.middle_name }}
{{ site.last_name }}. {{ site.footer_text }}
{% if site.impressum_path %}
<a href="{{ site.url }}{{ site.baseurl }}{{ site.impressum_path }}">Impressum</a>.
{% endif %}
{% if site.last_updated %}
Last updated: {{ 'now' | date: '%B %d, %Y' }}.
{% endif %}
{% endcapture %}
{% if site.footer_fixed %}
<footer class="fixed-bottom" role="contentinfo">
<div class="container mt-0">
&copy; Copyright {{ site.time | date: '%Y' }}
{{ site.first_name }}
{{ site.middle_name }}
{{ site.last_name }}. {{ site.footer_text }}
{% if site.impressum_path %}
<a href="{{ site.url }}{{ site.baseurl }}{{ site.impressum_path }}">Impressum</a>.
{% endif %}
{% if site.last_updated %}
Last updated: {{ 'now' | date: '%B %d, %Y' }}.
{% endif %}
{{ footer_contents }}
</div>
</footer>
{% else %}
@ -20,16 +24,7 @@
{% endif %}
<div class="container">
&copy; Copyright {{ site.time | date: '%Y' }}
{{ site.first_name }}
{{ site.middle_name }}
{{ site.last_name }}. {{ site.footer_text }}
{% if site.impressum_path %}
<a href="{{ site.url }}{{ site.baseurl }}{{ site.impressum_path }}">Impressum</a>.
{% endif %}
{% if site.last_updated %}
Last updated: {{ 'now' | date: '%B %d, %Y' }}.
{% endif %}
{{ footer_contents }}
</div>
</footer>
{% endif %}