Create blog templates and set data

This commit is contained in:
Helen Chong 2024-04-16 01:39:56 +08:00
parent 19d40834a6
commit 819c25e26b
6 changed files with 32 additions and 0 deletions

View File

@ -25,4 +25,8 @@ eleventyComputed:
<article class="article">
{{ content | safe }}
</article>
{% if tags.includes("blog pages") %}
{% include "main/blognav.njk" %}
{% endif %}
</div>

View File

@ -17,4 +17,8 @@ layout: main/base
<div class="content {{'content--divided' if isContentDivided }}">
{{ content | safe }}
</div>
{% if tags.includes("blog pages") %}
{% include "main/blognav.njk" %}
{% endif %}
</div>

View File

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

11
src/blog/posts.njk Normal file
View File

@ -0,0 +1,11 @@
---
pagination:
data: collections.posts
size: 10
alias: postList
reverse: true
title: Blog Archive
layout: main/content
tags: blog pages
blogNav: Archive
---

View File

@ -0,0 +1,4 @@
{
"layout": "main/article",
"tags": "posts"
}

6
src/pages/blog.njk Normal file
View File

@ -0,0 +1,6 @@
---
layout: main/content
title: Blog
desc: Leilukin's blog.
tags: blog pages
---