diff --git a/templates/macros/post.html b/templates/macros/post.html new file mode 100644 index 0000000..469e6e0 --- /dev/null +++ b/templates/macros/post.html @@ -0,0 +1,108 @@ +{% macro content(page, summary, show_only_description) %} + {%- if show_only_description %} +
+ {{ page.description | safe }} +
+ {% elif summary and page.summary %} +
+ {{ page.summary | safe }} +
+
+ + + En savoir plus  + ↩︎ + +
+ {% else %} + {#- full content -#} +
+ {{ page.content | safe }} +
+ {%- endif %} +{% endmacro content %} + + +{% macro date(page) %} + + {%- if page.date %} + {{ page.date | date(format="%d-%m-%Y") }} + {% endif -%} + +{% endmacro post_date %} + + +{% macro earlier_later(page) %} + {%- if config.extra.enable_post_view_navigation and page.lower or page.higher %} + + {% endif -%} +{% endmacro earlier_later %} + + +{% macro header(page) %} +

{{ page.title }}

+
+ {{ post_macros::date(page=page) }} +
+ + {{ post_macros::tags(page=page) }} +{% endmacro header %} + + +{% macro list_posts(pages) %} + +{% endmacro list_posts %} + + +{% macro tags(page, short=false) %} + {%- if page.taxonomies and page.taxonomies.tags %} + + {%- if short %} + :: + {%- set sep = "," -%} + {% else %} + :: tags:  + {%- set sep = " " -%} + {% endif -%} + {%- for tag in page.taxonomies.tags | sort | unique(case_sensitive=false) %} + #{{ tag }} + {%- if not loop.last %}{{ sep | safe }}{% endif -%} + {% endfor -%} + + {% endif -%} +{% endmacro tags %}