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