leilukin-site/src/pages/blog.njk

44 lines
1.2 KiB
Plaintext
Raw Normal View History

2024-04-15 17:39:56 +00:00
---
layout: main/content
title: Blog
2024-04-16 07:47:30 +00:00
desc: Blog hosted on Leilukin's personal website.
2024-04-15 17:39:56 +00:00
tags: blog pages
2024-04-16 07:47:30 +00:00
pageTitle: Welcome to Leilukin's Hub Blog!
2024-04-16 08:56:15 +00:00
pagination:
data: collections.posts
size: 5
alias: postList
reverse: true
permalink: "/{{ page.fileSlug }}{% if pagination.pageNumber > 0 %}/page/{{ pagination.pageNumber + 1 }}{% endif %}/"
---
<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>