diff options
Diffstat (limited to 'templates/macros.html')
-rw-r--r-- | templates/macros.html | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/templates/macros.html b/templates/macros.html new file mode 100644 index 0000000..9f0f792 --- /dev/null +++ b/templates/macros.html @@ -0,0 +1,43 @@ +{% macro render_post(post, mention=false, in_feed=true) -%} +{% if mention -%} +<article class="mention"> +{% else -%} +<article> +{% endif -%} + <header> + <img class="avatar" alt="{{ config.extra.author }}" src="{{ config.extra.avatar }}" /> + <div class="banner smaller"> + <span class="info"> + <a class="bold-hover" title="permalink to this post" href="{{ post.permalink }}">{% if mention %}№ {{ post.slug }} {% else %}§{% endif %}</a> + <time class="mute" datetime="{{ post.date }}" title="{{ post.date }}">{{ post.date | date(format="%F %R") }}</time> + {%- if post.draft %}<span class="warning">DRAFT</span>{% endif %} + </span> + {%- if "tags" in post.taxonomies %} + <nav class="tags"> + <ul class="inline">{{ self::render_tags(tags=post.taxonomies.tags) }}</ul> + </nav> + {%- endif %} + </div> + </header> + <section class="post">{{ post.content | safe }}</section> +</article> +{% endmacro render_post -%} + +{%- macro render_pagination(paginator) %} +{%- if paginator.number_pagers > 1 %} +<nav class="pagination"> + {%- if paginator.previous %} + <a class="newer" href="{{ paginator.previous }}">‹ newer</a> + {%- endif %} + {%- if paginator.next %} + <a class="older" href="{{ paginator.next }}">older ›</a> + {%- endif %} +</nav> +{%- endif %} +{%- endmacro render_pagination -%} + +{%- macro render_tags(tags) %} +{%- for tag in tags %} + <li><a class="tag" href="{{ get_taxonomy_url(kind="tags", name=tag) }}">{{ tag }}</a></li> +{%- endfor %} +{%- endmacro render_tags %} |