List latest articles on Index
This commit is contained in:
16
templates/macros.html
Normal file
16
templates/macros.html
Normal file
@ -0,0 +1,16 @@
|
||||
{% 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>
|
||||
</article>
|
||||
{% endmacro %}
|
Reference in New Issue
Block a user