Skip to content

Commit 74beacb

Browse files
authored
Refactor footer content (#3041)
Refactor footer content into a reusable variable for cleaner code
1 parent 6625f23 commit 74beacb

File tree

1 file changed

+15
-20
lines changed

1 file changed

+15
-20
lines changed

_includes/footer.liquid

+15-20
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
1+
{% capture footer_contents %}
2+
© Copyright {{ site.time | date: '%Y' }}
3+
{{ site.first_name }}
4+
{{ site.middle_name }}
5+
{{ site.last_name }}. {{ site.footer_text }}
6+
{% if site.impressum_path %}
7+
<a href="{{ site.url }}{{ site.baseurl }}{{ site.impressum_path }}">Impressum</a>.
8+
{% endif %}
9+
{% if site.last_updated %}
10+
Last updated: {{ 'now' | date: '%B %d, %Y' }}.
11+
{% endif %}
12+
{% endcapture %}
13+
114
{% if site.footer_fixed %}
215
<footer class="fixed-bottom" role="contentinfo">
316
<div class="container mt-0">
4-
&copy; Copyright {{ site.time | date: '%Y' }}
5-
{{ site.first_name }}
6-
{{ site.middle_name }}
7-
{{ site.last_name }}. {{ site.footer_text }}
8-
{% if site.impressum_path %}
9-
<a href="{{ site.url }}{{ site.baseurl }}{{ site.impressum_path }}">Impressum</a>.
10-
{% endif %}
11-
{% if site.last_updated %}
12-
Last updated: {{ 'now' | date: '%B %d, %Y' }}.
13-
{% endif %}
17+
{{ footer_contents }}
1418
</div>
1519
</footer>
1620
{% else %}
@@ -20,16 +24,7 @@
2024
{% endif %}
2125

2226
<div class="container">
23-
&copy; Copyright {{ site.time | date: '%Y' }}
24-
{{ site.first_name }}
25-
{{ site.middle_name }}
26-
{{ site.last_name }}. {{ site.footer_text }}
27-
{% if site.impressum_path %}
28-
<a href="{{ site.url }}{{ site.baseurl }}{{ site.impressum_path }}">Impressum</a>.
29-
{% endif %}
30-
{% if site.last_updated %}
31-
Last updated: {{ 'now' | date: '%B %d, %Y' }}.
32-
{% endif %}
27+
{{ footer_contents }}
3328
</div>
3429
</footer>
3530
{% endif %}

0 commit comments

Comments
 (0)