Skip to content

Commit

Permalink
Extract footer to a 'content' template
Browse files Browse the repository at this point in the history
  • Loading branch information
jultty committed Nov 16, 2024
1 parent f2e8988 commit 4a2275d
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion content/posts/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
title = "Posts"
sort_by = "date"
template = "posts.html"
page_template = "post-page.html"
page_template = "content.html"
generate_feeds = true
+++
2 changes: 1 addition & 1 deletion content/posts/_index.pt.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 24 additions & 0 deletions templates/content.html
Original file line number Diff line number Diff line change
@@ -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 -%}
2 changes: 1 addition & 1 deletion templates/link-page.html
Original file line number Diff line number Diff line change
@@ -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>
Expand Down
24 changes: 0 additions & 24 deletions templates/post-page.html

This file was deleted.

0 comments on commit 4a2275d

Please sign in to comment.