More universal macro for listing posts
This commit is contained in:
parent
e20c485d03
commit
194fcc5b92
@ -21,7 +21,7 @@
|
|||||||
</aside>
|
</aside>
|
||||||
<main>
|
<main>
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{{ macros::posts_latest(section="posts", count=config.extra.latest_posts_count) }}
|
{{ macros::list_posts(section="posts", count=config.extra.latest_posts_count) }}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
</main>
|
</main>
|
||||||
</body>
|
</body>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{% macro posts_latest(section, count) %}
|
{% macro list_posts(section, count=0) %}
|
||||||
{% set section = get_section(path=section~"/_index.md") %}
|
{% set section = get_section(path=section~"/_index.md") %}
|
||||||
{% for page in section.pages %}
|
{% for page in section.pages %}
|
||||||
{% if loop.index > count %}
|
{% if loop.index > count and count != 0 %}
|
||||||
{% break %}
|
{% break %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{{ macros::print_article(page=page) }}
|
{{ macros::print_article(page=page) }}
|
||||||
|
Loading…
Reference in New Issue
Block a user