Extract footer to a 'content' template

This commit is contained in:
jultty 2024-11-16 15:32:14 -03:00
commit 4a2275dfe6
5 changed files with 27 additions and 27 deletions

View file

@ -2,6 +2,6 @@
title = "Posts"
sort_by = "date"
template = "posts.html"
page_template = "post-page.html"
page_template = "content.html"
generate_feeds = true
+++

View file

@ -2,6 +2,6 @@
title = "Posts"
sort_by = "date"
template = "posts.html"
page_template = "post-page.html"
page_template = "content.html"
generate_feeds = true
+++

24
templates/content.html Normal file
View file

@ -0,0 +1,24 @@
{% extends "base.html" %}
{% block content %}
<article class="blog-post">
<h1 id="post-title">{{ page.title }}</h1>
<time class="post-date">{{ page.date -}}</time>
{{ page.content | safe }}
</article>
{%- endblock content -%}
{%- block footer %}
<hr/>
<p class="footer-text">
{%- if lang == "pt" %}feito por{% else %}made by{% endif %} <a href="https://jutty.dev">jutty</a>
{% if lang == "pt" %}com{% else %}with{% endif %} <a href="https://www.getzola.org/">Zola</a>
&bullet; {% if lang != "pt" %}BSD-licensed{% endif %}
<a href="https://github.com/jultty/blog">{% if lang == "pt" %}código fonte{% else %}source code{% endif %}</a>
{% if lang == "pt" %}sob a licença BSD{% endif %}
&bullet; <a href="{{ get_url(path="acknowledgments") }}">{% if lang == "pt" %}créditos{% else %}acknowledgments{% endif %}</a>
<br/>
{% if lang == "pt" %}gerado em{% else %}built{% endif %} <time>{{ now(utc=true) | date(format="%Y-%m-%d %H:%M") }} UTC</time>,
{{ now(timestamp=true) }}{% if lang == "pt" %}&#xba; segundo não-bissexto da Era Unix{% else %} non-leap seconds since the Unix Epoch{% endif %}
</p>
{% endblock footer -%}

View file

@ -1,4 +1,4 @@
{% extends "base.html" %}
{% extends "content.html" %}
{%- block content %}
<h1 id="post-title"><a href="{{ page.extra.url }}">{{ page.title }}</a></h1>

View file

@ -1,24 +0,0 @@
{% extends "base.html" %}
{% block content %}
<article class="blog-post">
<h1 id="post-title">{{ page.title }}</h1>
<time class="post-date">{{ page.date -}}</time>
{{ page.content | safe }}
</article>
{%- endblock content -%}
{%- block footer %}
<hr/>
<p class="footer-text">
{%- if lang == "pt" %}feito por{% else %}made by{% endif %} <a href="https://jutty.dev">jutty</a>
{% if lang == "pt" %}com{% else %}with{% endif %} <a href="https://www.getzola.org/">Zola</a>
&bullet; {% if lang != "pt" %}BSD-licensed{% endif %}
<a href="https://github.com/jultty/blog">{% if lang == "pt" %}código fonte{% else %}source code{% endif %}</a>
{% if lang == "pt" %}sob a licença BSD{% endif %}
&bullet; <a href="{{ get_url(path="acknowledgments") }}">{% if lang == "pt" %}créditos{% else %}acknowledgments{% endif %}</a>
<br/>
{% if lang == "pt" %}gerado em{% else %}built{% endif %} <time>{{ now(utc=true) | date(format="%Y-%m-%d %H:%M") }} UTC</time>,
{{ now(timestamp=true) }}{% if lang == "pt" %}&#xba; segundo não-bissexto da Era Unix{% else %} non-leap seconds since the Unix Epoch{% endif %}
</p>
{% endblock footer %}