diff options
Diffstat (limited to 'templates/post_macros.html')
| -rw-r--r-- | templates/post_macros.html | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/templates/post_macros.html b/templates/post_macros.html new file mode 100644 index 0000000..c128bc5 --- /dev/null +++ b/templates/post_macros.html @@ -0,0 +1,42 @@ +{% macro meta(post) %} + <hr> + <aside class="meta"> + <time datetime="{{ post.date }}">{{ post.date | date(format="%e %B %Y") }}</time> + {% if post.taxonomies.categories %} + <article class="category"> + § + {% for category in post.taxonomies.categories %} + <a href="{{ get_taxonomy_url(kind="categories", name=category) }}">{{ category }}</a> + {% endfor %} + </article> + {% endif %} + {% if post.taxonomies.categories %} + <article class="tags"> + ∈ + <menu> + {% for tag in post.taxonomies.tags %} + <li><a href="{{ get_taxonomy_url(kind="tags", name=tag) }}">{{ tag }}</a></li> + {% endfor %} + </menu> + </article> + {% endif %} + </aside> +{% endmacro meta %} + +{% macro summary(post) %} +<article class="post-summary"> + <h2> + <a href="{{ post.permalink }}">{{ post.title }}</a> + </h2> + {{ post_macros::meta(post=post) }} + {% if post.extra.visual_aid_src and post.extra.visual_aid_alt %} + <section class="hero-summary"> + {% set resized_image = resize_image(path=post.extra.visual_aid_src, width=100, height=75) %} + <img src="{{ resized_image.url }}" alt="{{post.extra.visual_aid_alt}}" title="{{post.extra.visual_aid_alt}}"> + <p>{{ post.summary | safe }}</p> + </section> + {% else %} + <p>{{ post.summary | safe }}</p> + {% endif %} +</article> +{% endmacro summary %} |