This commit is contained in:
Yan Lin 2026-01-30 16:55:01 +01:00
parent 9380ddf4d1
commit 485e2efa1a
5 changed files with 86 additions and 9 deletions

View file

@ -22,9 +22,11 @@
<header>
<nav>
<a href="{{ get_url(path='/') }}" class="site-title">{{ config.title }}</a>
<a href="{{ get_url(path='ais') }}">AI Systems</a>
<a href="{{ get_url(path='homelab') }}">Homelab</a>
<a href="{{ get_url(path='ml-tech') }}">ML Tech</a>
{% set root = get_section(path="_index.md") %}
{% for path in root.subsections %}
{% set s = get_section(path=path) %}
<a href="{{ s.permalink }}">{{ s.title }}</a>
{% endfor %}
</nav>
</header>
<main>

View file

@ -7,10 +7,20 @@
<section class="recent-posts">
<h2>Recent Posts</h2>
{% set ais = get_section(path="ais/_index.md") %}
{% set homelab = get_section(path="homelab/_index.md") %}
{% set ml_tech = get_section(path="ml-tech/_index.md") %}
{% set all_pages = ais.pages | concat(with=homelab.pages) | concat(with=ml_tech.pages) %}
{% 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 %}
<ul class="post-list">
{% for page in all_pages | sort(attribute="date") | reverse | slice(end=5) %}
<li>

View file

@ -12,7 +12,12 @@
{% endif %}
<ul class="post-list">
{% for page in section.pages %}
{% if paginator %}
{% set pages = paginator.pages %}
{% else %}
{% set pages = section.pages %}
{% endif %}
{% for page in pages %}
<li>
<time datetime="{{ page.date }}">{{ page.date | date(format="%Y-%m-%d") }}</time>
<a href="{{ page.permalink }}">{{ page.title }}</a>