diff options
author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2025-04-25 12:09:21 +0200 |
---|---|---|
committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2025-04-25 12:09:21 +0200 |
commit | 6acf4ab874c58ee14f35da671029e56972745ce6 (patch) | |
tree | bc6dfe4f3661332e8c1fc6ff4ca657185db488e4 /src/themes/serene/templates/blog.html | |
parent | fix(flake): Ensure that the `dead-trees` directory exists (diff) | |
download | b-peetz.de-6acf4ab874c58ee14f35da671029e56972745ce6.zip |
feat(treewide): Migrate to zola
Diffstat (limited to 'src/themes/serene/templates/blog.html')
-rw-r--r-- | src/themes/serene/templates/blog.html | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/src/themes/serene/templates/blog.html b/src/themes/serene/templates/blog.html new file mode 100644 index 0000000..c654e86 --- /dev/null +++ b/src/themes/serene/templates/blog.html @@ -0,0 +1,50 @@ +{% import "macros/prose.html" as macros %} +{% extends "_base.html" %} + +{% block page %}blog{% endblock page%} +{% block lang %}{% if section.extra.lang %}{{ section.extra.lang }}{% else %}{{ section.lang }}{% endif %}{% endblock lang %} +{% block title %}{{ section.title }}{% endblock title %} +{% block desc %} + {% if section.description %} + {% set desc = section.description %} + {% else %} + {% set desc = config.description %} + {% endif %} + <meta name="description" content="{{ desc }}"> +{% endblock desc %} + +{% block content %} +<div id="wrapper"> + {{ macros::back_link(path = get_url(path="/")) }} + {% include "_section_title.html" %} + <main class="layout-list"> + {% if section.extra.categorized %} + {% for category,posts in section.pages | sort(attribute="taxonomies.categories.0") | group_by(attribute="taxonomies.categories.0") %} + {% set category_name = category %} + {% if category is matching("^__[0-9]{2}__") %} + {% set category_name = category | split(pat="") | slice(start=7) | join(sep="") %} + {% endif %} + <h2 class="category">{{ category_name }}</h2> + <div class="post-list categorized"> + {% for post in posts %} + <a class="post instant {% if post.extra.featured %}featured{% endif %}" href="{{ post.permalink }}"> + <span>{{ post.title }}</span> + <span class="date">{{ post.date | date(format=section.extra.date_format) }}</span> + </a> + {% endfor %} + </div> + {% endfor %} + {% else %} + <div class="post-list"> + {% for post in section.pages %} + <a class="post instant {% if post.extra.featured %}featured{% endif %}" href="{{ post.permalink }}"> + <span>{{ post.title }}</span> + <span class="date">{{ post.date | date(format=section.extra.date_format) }}</span> + </a> + {% endfor %} + </div> + {% endif %} + </main> + {% include "_footer.html" %} +</div> +{% endblock content %} |