Set blog navigation items

This commit is contained in:
Helen Chong 2024-04-16 17:09:38 +08:00
parent 4a1e98f337
commit 380a9f3eb9
4 changed files with 39 additions and 4 deletions

View File

@ -1,5 +1,11 @@
<aside class="right-sidebar"> <aside class="right-sidebar">
<nav class="blog__nav"> <nav class="blog__nav">
<h2 class="blog__nav--title">Blog Navigation</h2> <h2 class="blog__nav--title">Blog Navigation</h2>
<ul class="blog__nav--links">
{% for page in collections["blog pages"] %}
<li><a href="{{ page.url }}">{{ page.data.blogNav }}</a>
</li>
{% endfor %}
</ul>
</nav> </nav>
</aside> </aside>

View File

@ -1,3 +0,0 @@
{
"tags": "blog pages"
}

View File

@ -9,3 +9,34 @@ layout: main/content
tags: blog pages tags: blog pages
blogNav: Archive blogNav: Archive
--- ---
<ul class="blog__postlist">
{% for post in postList %}
<li>
<h2 class="blog__title">
<a href="{{ post.url }}">
{% if post.data.title %}{{ post.data.articleTitle }}
{% else %}
<code>{{ post.url }}</code>
{% endif %}
</a>
</h2>
<time>{{ post.date | niceDate }}</time>
<p>{{ post.data.desc }}</p>
</li>
{% endfor %}
</ul>
<p class="center-text">
{% if pagination.href.previous %}
<a href=" {{ pagination.href.previous }}">Previous</a>
{% else %}
Previous
{% endif %}
/
{% if pagination.href.next %}
<a href=" {{ pagination.href.next }}">Next</a>
{% else %}
Next
{% endif %}
</p>

View File

@ -4,6 +4,7 @@ title: Blog
desc: Blog hosted on Leilukin's personal website. desc: Blog hosted on Leilukin's personal website.
tags: blog pages tags: blog pages
pageTitle: Welcome to Leilukin's Hub Blog! pageTitle: Welcome to Leilukin's Hub Blog!
blogNav: Blog Home
pagination: pagination:
data: collections.posts data: collections.posts
size: 5 size: 5