You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1.6 KiB
HTML
55 lines
1.6 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::list_article(page=page) }}
|
|
{% endfor %}
|
|
{% endmacro posts_latest %}
|
|
|
|
{% macro list_taxonomy(title, kind) %}
|
|
<span class="title">{{ title }}</span>
|
|
<ul>
|
|
{% set tags = get_taxonomy(kind=kind) %}
|
|
{% for term in tags.items %}
|
|
<li class="item"><a href="{{ term.permalink | safe }}">{{ term.name |capitalize }}</a></li>
|
|
{% endfor %}
|
|
</ul>
|
|
{% endmacro list_categories %}
|
|
|
|
{% macro page_info(page) %}
|
|
<div class="info">
|
|
<span class="date">{{ page.date }}</span>
|
|
{%- if page.extra.author -%}
|
|
, <span class="author">{{ page.extra.author }}</span>
|
|
{% endif %}
|
|
|
|
{% if page.taxonomies.tags %}
|
|
<div class="taxonomy">
|
|
<ul>
|
|
{% for tag in page.taxonomies.tags %}
|
|
<li><a href="{{ get_taxonomy_url(kind="tags", name=tag) | safe }}">#{{ tag }}</a></li>
|
|
{% endfor %}
|
|
</ul>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
{% endmacro page_info %}
|
|
|
|
{% macro list_article(page) %}
|
|
<article>
|
|
<h1><a href="{{ page.permalink }}">{{ page.title }}</a></h1>
|
|
<p>{{ page.summary | safe }}</p>
|
|
{{ self::page_info(page=page) }}
|
|
</article>
|
|
{% endmacro list_articles %}
|
|
|
|
{% macro pagination(paginator) %}
|
|
<div class="pagination">
|
|
{% if paginator.previous %}<a href="{{ paginator.previous }}">«</a>{% endif %}
|
|
<span class="currentpage">{{ paginator.current_index }} / {{ paginator.number_pagers }}</span>
|
|
{% if paginator.next %}<a href="{{ paginator.next }}">»</a>{% endif %}
|
|
</div>
|
|
{% endmacro pagination %}
|