diff options
author | Valentin Popov <valentin@popov.link> | 2022-11-10 03:35:29 +0300 |
---|---|---|
committer | Valentin Popov <valentin@popov.link> | 2022-11-10 03:35:29 +0300 |
commit | ac8c59793627c5d954673cb022eaad9c514fe638 (patch) | |
tree | 9f2645be10a17ffa5a9daab1ed78a1183c06e796 /templates | |
parent | 837476f899f191079cf727648c396d3c5b5084e0 (diff) | |
download | popov.link-ac8c59793627c5d954673cb022eaad9c514fe638.tar.xz popov.link-ac8c59793627c5d954673cb022eaad9c514fe638.zip |
Split recent posts
Signed-off-by: Valentin Popov <valentin@popov.link>
Diffstat (limited to 'templates')
-rw-r--r-- | templates/includes/recent_posts.html | 10 | ||||
-rw-r--r-- | templates/index.html | 12 |
2 files changed, 11 insertions, 11 deletions
diff --git a/templates/includes/recent_posts.html b/templates/includes/recent_posts.html new file mode 100644 index 0000000..795ea06 --- /dev/null +++ b/templates/includes/recent_posts.html @@ -0,0 +1,10 @@ +{% set blog = get_section(path='blog/_index.md') %} +<ul> + {% for page in blog.pages | slice(end=5) %} + <li> + <time datetime="{{ page.date | date(format='%+') | trim }}">{{ page.date | date(format='%Y/%m/%d') | trim }}</time> + <span>—</span> + <a href="{{ page.permalink | trim }}">{{ page.title | trim }}</a> + </li> + {% endfor %} +</ul>
\ No newline at end of file diff --git a/templates/index.html b/templates/index.html index 29b4aeb..92a9b12 100644 --- a/templates/index.html +++ b/templates/index.html @@ -17,17 +17,7 @@ </section> <section> - {% set blog = get_section(path='blog/_index.md') %} <h2>Recent posts</h2> - - <ul> - {% for page in blog.pages | slice(end=5) %} - <li> - <time datetime="{{ page.date | date(format='%+') | trim }}">{{ page.date | date(format='%Y/%m/%d') | trim }}</time> - <span>—</span> - <a href="{{ page.permalink | trim }}">{{ page.title | trim }}</a> - </li> - {% endfor %} - </ul> + {% include 'includes/recent_posts.html' %} </section> {% endblock content %}
\ No newline at end of file |