zola-theme-terminimal/templates/macros/post.html

104 lines
3.5 KiB
HTML
Raw Normal View History

2019-02-05 18:27:02 +00:00
{% macro content(page, summary) %}
{%- if summary and page.summary %}
<div class="post-content">
{{ page.summary | safe }}
</div>
<div>
2019-02-05 21:00:19 +00:00
<!-- &#xFE0E; -- force text style - some devices render this as emoji -->
2019-04-03 17:21:19 +00:00
<a class="read-more button" href="{{ page.permalink | safe }}">
<span class="button__text">Read more</span>&nbsp;
<span class="button__icon">&#8617;&#xFE0E;</span>
</a>
2019-02-05 18:27:02 +00:00
</div>
{% else %}
<div class="post-content">
{{ page.content | safe }}
</div>
{%- endif %}
{% endmacro content %}
{% macro date(page) %}
<span class="post-date">
{%- if page.date %}
{{ page.date | date(format="%Y-%m-%d") }}
{% endif -%}
</span>
{% endmacro post_date %}
{% macro earlier_later(page) %}
2022-11-10 10:53:45 +00:00
{%- if config.extra.enable_post_view_navigation and page.lower or page.higher %}
2019-02-05 18:27:02 +00:00
<div class="pagination">
<div class="pagination__title">
<span class="pagination__title-h">{{ config.extra.post_view_navigation_prompt }}</span>
<hr />
</div>
<div class="pagination__buttons">
2022-11-10 10:53:45 +00:00
{%- if page.higher %}
2019-02-05 18:27:02 +00:00
<span class="button previous">
2022-11-10 10:53:45 +00:00
<a href="{{ page.higher.permalink | safe }}">
2019-02-05 18:27:02 +00:00
<span class="button__icon"></span>&nbsp;
2022-11-10 10:53:45 +00:00
<span class="button__text">{{ page.higher.title }}</span>
2019-02-05 18:27:02 +00:00
</a>
</span>
{% endif %}
2022-11-10 10:53:45 +00:00
{% if page.lower %}
2019-02-05 18:27:02 +00:00
<span class="button next">
2022-11-10 10:53:45 +00:00
<a href="{{ page.lower.permalink | safe }}">
<span class="button__text">{{ page.lower.title }}</span>&nbsp;
2019-02-05 18:27:02 +00:00
<span class="button__icon"></span>
</a>
</span>
{% endif -%}
</div>
</div>
{% endif -%}
{% endmacro earlier_later %}
{% macro header(page) %}
2019-04-03 17:21:19 +00:00
<h1 class="post-title"><a href="{{ page.permalink | safe }}">{{ page.title }}</a></h1>
2019-02-05 18:27:02 +00:00
<div class="post-meta-inline">
{{ post_macros::date(page=page) }}
</div>
{{ post_macros::tags(page=page) }}
{% endmacro header %}
{% macro list_posts(pages) %}
<ul>
{%- for page in pages %}
2019-03-02 11:49:42 +00:00
{%- if page.draft %}
{% continue %}
{% endif -%}
2019-02-05 18:27:02 +00:00
<li class="post-list">
2019-04-03 17:21:19 +00:00
<a href="{{ page.permalink | safe }}">
2019-02-05 18:27:02 +00:00
<span class="post-date">{{ page.date }}</span>
:: <span class="post-list-title">{{ page.title }}</span></a>
{{ post_macros::tags(page=page, short=true) }}
</li>
{% endfor -%}
</ul>
{% endmacro list_posts %}
{% macro tags(page, short=false) %}
{%- if page.taxonomies and page.taxonomies.tags %}
<span class="post-tags-inline">
{%- if short %}
::
{%- set sep = "," -%}
{% else %}
:: tags:&nbsp;
{%- set sep = "&nbsp;" -%}
{% endif -%}
{%- for tag in page.taxonomies.tags | sort | unique(case_sensitive=false) %}
2019-04-03 17:21:19 +00:00
<a class="post-tag" href="{{ get_taxonomy_url(kind='tags', name=tag) | safe }}">#{{ tag }}</a>
2019-02-05 18:27:02 +00:00
{%- if not loop.last %}{{ sep | safe }}{% endif -%}
{% endfor -%}
</span>
{% endif -%}
{% endmacro tags %}