summaryrefslogtreecommitdiffstats
path: root/src/themes/serene/templates/posts.html
diff options
context:
space:
mode:
Diffstat (limited to 'src/themes/serene/templates/posts.html')
-rw-r--r--src/themes/serene/templates/posts.html58
1 files changed, 58 insertions, 0 deletions
diff --git a/src/themes/serene/templates/posts.html b/src/themes/serene/templates/posts.html
new file mode 100644
index 0000000..9b3dec1
--- /dev/null
+++ b/src/themes/serene/templates/posts.html
@@ -0,0 +1,58 @@
+{% 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 %}
+ {%- 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">
+ {{ <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 %}
+ {% 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(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 }}">
+ <span>{{ post.title }}</span>
+ <span class="date">{{ post.date | date(format=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=date_format) }}</span>
+ </a>
+ {% endfor %}
+ </div>
+ {% endif %}
+ </main>
+ {% include "_footer.html" %}
+</div>
+{% endblock content %}