diff options
Diffstat (limited to '')
| -rw-r--r-- | src/themes/serene/templates/posts.html (renamed from src/themes/serene/templates/blog.html) | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/src/themes/serene/templates/blog.html b/src/themes/serene/templates/posts.html index 2519d28..9b3dec1 100644 --- a/src/themes/serene/templates/blog.html +++ b/src/themes/serene/templates/posts.html @@ -1,4 +1,3 @@ -{% import "macros/prose.html" as macros %} {% extends "_base.html" %} {% block page %}blog{% endblock page%} @@ -10,26 +9,35 @@ {% else %} {% set desc = config.description %} {% endif %} - <meta name="description" content="{{ desc }}"> + {%- if section.extra.lang %}{% set og_lang = section.extra.lang %}{% else %}{% set og_lang = section.lang %}{% endif -%} + {{ <seo config + title={section.title} + desc={desc} + url={section.permalink} + lang={og_lang} /> }} {% endblock desc %} {% block content %} <div id="wrapper"> - {{ macros::back_link(path = get_url(path="/")) }} + {{ <back_link path={get_url(path="/")} config /> }} {% include "_section_title.html" %} <main class="layout-list"> + {% set date_format = section.extra.date_format if section.extra.date_format is defined else (config.extra.date_format if config.extra.date_format is defined else "%b %-d, %Y") %} {% if section.extra.categorized %} - {% for category,posts in section.pages | sort(attribute="taxonomies.categories.0") | group_by(attribute="taxonomies.categories.0") %} + {% set categorized_posts = [post for post in section.pages if post.taxonomies?.categories] %} + {% set categories = [post.taxonomies.categories[0] for post in categorized_posts] | unique | sort %} + {% for category in categories %} + {% set posts = [post for post in categorized_posts if post.taxonomies.categories[0] == category] %} {% set category_name = category %} - {% if category is matching("^__[0-9]{2}__") %} - {% set category_name = category | split(pat="") | slice(start=7) | join(sep="") %} + {% if category is matching(pat="^__[0-9]{2}__") %} + {% set category_name = category[6:] %} {% 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 | safe }}"> + <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> + <span class="date">{{ post.date | date(format=date_format) }}</span> </a> {% endfor %} </div> @@ -37,9 +45,9 @@ {% else %} <div class="post-list"> {% for post in section.pages %} - <a class="post instant {% if post.extra.featured %}featured{% endif %}" href="{{ post.permalink | safe }}"> + <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> + <span class="date">{{ post.date | date(format=date_format) }}</span> </a> {% endfor %} </div> |
