summaryrefslogblamecommitdiffstatshomepage
path: root/templates/macros.html
blob: f504f76a1bb2599d6a6d731cf66a2ab2a7766f96 (plain) (tree)
1
2
3
4
5
6
7
8
9

                                            
                
                                                                                                                 
                                            
                                          
                                                                                                                                                
                                                                                                                                              
                              








                                                                                                          
                            


















                                                                                                  
{% macro render_post(post, class="feed") -%}
<article class="{{ class }}">
	<header>
		<img class="avatar" alt="{{ config.extra.author }}" src="{{ config.extra.avatar }}" width="64" />
		<div class="banner smaller">
			<div class="info">
				<time class="mute" datetime="{{ post.date }}" title="{{ post.date }}">{{ post.date | date(format="%F") }}</time>
				<h2 class="mute title"><a title="permalink to this post" href="{{ post.permalink }}">{{ post.title }}</a></h2>
			</div>
			{%- 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 %}