fix recent posts
This commit is contained in:
parent
62f684a548
commit
72b8cf0132
3 changed files with 6 additions and 15 deletions
|
|
@ -1,5 +1,5 @@
|
|||
+++
|
||||
title = "Welcome"
|
||||
title = "Yan Lin's Blog"
|
||||
+++
|
||||
|
||||
My name is Yan Lin, and this is my personal blog where I occasionally post my thoughts and findings during research.
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
title = "Homelab"
|
||||
sort_by = "date"
|
||||
paginate_by = 10
|
||||
weight = 2
|
||||
+++
|
||||
|
||||
My experience and stories tinkering with home servers, personal cloud, etc.
|
||||
|
|
|
|||
|
|
@ -8,19 +8,11 @@
|
|||
<section class="recent-posts">
|
||||
<p style=" font-size: 1.1rem; font-weight: bold; ">Recent Posts</p>
|
||||
{% set root = get_section(path="_index.md") %}
|
||||
{% set all_pages = [] %}
|
||||
{% if root.subsections[0] is defined %}
|
||||
{% set s0 = get_section(path=root.subsections[0]) %}
|
||||
{% set all_pages = all_pages | concat(with=s0.pages) %}
|
||||
{% endif %}
|
||||
{% if root.subsections[1] is defined %}
|
||||
{% set s1 = get_section(path=root.subsections[1]) %}
|
||||
{% set all_pages = all_pages | concat(with=s1.pages) %}
|
||||
{% endif %}
|
||||
{% if root.subsections[2] is defined %}
|
||||
{% set s2 = get_section(path=root.subsections[2]) %}
|
||||
{% set all_pages = all_pages | concat(with=s2.pages) %}
|
||||
{% endif %}
|
||||
{% set_global all_pages = [] %}
|
||||
{% for subsection_path in root.subsections %}
|
||||
{% set subsection = get_section(path=subsection_path) %}
|
||||
{% set_global all_pages = all_pages | concat(with=subsection.pages) %}
|
||||
{% endfor %}
|
||||
<ul class="post-list">
|
||||
{% for page in all_pages | sort(attribute="date") | reverse | slice(end=7) %}
|
||||
<li>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue