39 lines
1.0 KiB
HTML
39 lines
1.0 KiB
HTML
{% macro posts_latest(section, count) %}
|
|
{% set section = get_section(path=section~"/_index.md") %}
|
|
{% for page in section.pages %}
|
|
{% if loop.index > count %}
|
|
{% break %}
|
|
{% endif %}
|
|
{{ macros::print_article(page=page) }}
|
|
{% endfor %}
|
|
{% endmacro %}
|
|
|
|
{% macro print_article(page) %}
|
|
<article>
|
|
<h1><a href="{{ page.permalink }}">{{ page.title }}</a></h1>
|
|
<p>{{ page.summary | safe }}</p>
|
|
{{ self::page_info(page=page) }}
|
|
</article>
|
|
{% endmacro %}
|
|
|
|
{% macro page_info(page) %}
|
|
{% if page.date %}
|
|
<div class="info">
|
|
<span class="date">{{ page.date }}</span>
|
|
{%- if page.extra.author -%}
|
|
, <span class="author">{{ page.extra.author }}</span>
|
|
{% endif %}
|
|
</div>
|
|
{% endif %}
|
|
{% endmacro %}
|
|
|
|
{% macro list_taxonomy(title, kind) %}
|
|
<span class="title">{{ title }}</span>
|
|
<ul>
|
|
{% set taxonomy = get_taxonomy(kind=kind) %}
|
|
{% for term in taxonomy.items %}
|
|
<li class="item"><a href="{{ term.permalink | safe }}">{{ term.name }}</a></li>
|
|
{% endfor %}
|
|
</ul>
|
|
{% endmacro list_categories %}
|