From 77ffc8dfeabd45cb3fac500902fcbcb7176edcc7 Mon Sep 17 00:00:00 2001 From: sefidel Date: Sun, 26 Mar 2023 16:55:25 +0900 Subject: project: Initial commit --- templates/macros/posts.html | 61 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 templates/macros/posts.html (limited to 'templates/macros/posts.html') diff --git a/templates/macros/posts.html b/templates/macros/posts.html new file mode 100644 index 0000000..506adff --- /dev/null +++ b/templates/macros/posts.html @@ -0,0 +1,61 @@ +{% macro display(pages) %} +
+ + {% for page in pages %} +
+
+ +

{{ posts::link(page=page) }}

+ +
+
+ {% endfor %} +
+{% endmacro display %} + +{% macro link(page) %} + {{ page.title }} +{% endmacro link %} + +{% macro meta(page) %} + {% if page.date %} + Published on {{ page.date }} + {% endif %} + {% if page.updated %} + | Edited on {{ page.updated }} + {% endif %} + {% if page.taxonomies %} + :: {{ posts::taxonomies(taxonomies=page.taxonomies) }} + {% endif %} +{% endmacro meta %} + +{% macro taxonomies(taxonomies) %} + {% if taxonomies.categories %} + {{ posts::categories(categories=taxonomies.categories) }} + {% endif %} + {% if taxonomies.tags %} + {{ posts::tags(tags=taxonomies.tags) }} + {% endif %} +{% endmacro taxonomies %} + +{% macro categories(categories) %} + [ + {% for category in categories %} + {% if loop.last %} + {{ category }} + {% else %} + {{ category }}, + {% endif %} + {% endfor %} + ] +{% endmacro categories %} + +{% macro tags(tags) %} + {% for tag in tags %} + {% if loop.last %} + #{{ tag }} + {% else %} + #{{ tag }}, + {% endif %} + {% endfor %} +{% endmacro tags %} -- cgit 1.4.1