59 lines
1.9 KiB
HTML
59 lines
1.9 KiB
HTML
{% macro post_list_item(page, show_tags=true, show_series=true) %}
|
|
<li class="post-list__item">
|
|
<h2 class="post-list__title">
|
|
<a href="{{ page.permalink }}">{{ page.title }}</a>
|
|
</h2>
|
|
{% if show_series %}
|
|
{% set path_parts = page.relative_path | split(pat="/") %}
|
|
{% if path_parts | length > 2 %}
|
|
{% set parent_dir = path_parts | slice(end=-2) | join(sep="/") %}
|
|
{% set parent_section = get_section(path=parent_dir ~ "/_index.md") %}
|
|
{% if parent_section and parent_section.extra.series %}
|
|
<p class="post-list__series">Part of the series: <a href="{{ parent_section.permalink }}">{{ parent_section.title }}</a></p>
|
|
{% endif %}
|
|
{% endif %}
|
|
{% endif %}
|
|
|
|
<div class="post-list__meta">
|
|
<time datetime="{{ page.date }}">{{ page.date | date(format="%B %d, %Y") }}</time>
|
|
|
|
{% if page.reading_time %}
|
|
<span aria-hidden="true">·</span>
|
|
<span>{{ page.reading_time }} min read</span>
|
|
{% endif %}
|
|
|
|
{% if show_tags and page.taxonomies.tags %}
|
|
<span aria-hidden="true">·</span>
|
|
<ul class="post-list__tags">
|
|
{% for tag in page.taxonomies.tags %}
|
|
<li><a href="{{ get_taxonomy_url(kind='tags', name=tag) }}">{{ tag }}</a></li>
|
|
{% endfor %}
|
|
</ul>
|
|
{% endif %}
|
|
</div>
|
|
|
|
{% if page.description %}
|
|
<p class="post-list__description">{{ page.description }}</p>
|
|
{% endif %}
|
|
</li>
|
|
{% endmacro %}
|
|
|
|
{% macro post_meta(page, show_tags=true) %}
|
|
<div class="post-meta">
|
|
<time datetime="{{ page.date }}">{{ page.date | date(format="%B %d, %Y") }}</time>
|
|
|
|
{% if page.reading_time %}
|
|
<span aria-hidden="true">·</span>
|
|
<span>{{ page.reading_time }} min read</span>
|
|
{% endif %}
|
|
|
|
{% if show_tags and page.taxonomies.tags %}
|
|
<span aria-hidden="true">·</span>
|
|
<ul class="post-meta__tags">
|
|
{% for tag in page.taxonomies.tags %}
|
|
<li><a href="{{ get_taxonomy_url(kind='tags', name=tag) }}">{{ tag }}</a></li>
|
|
{% endfor %}
|
|
</ul>
|
|
{% endif %}
|
|
</div>
|
|
{% endmacro %}
|