Create pages layouts

This commit is contained in:
TheThomaas 2023-11-13 21:06:36 +01:00
parent ed48bcf544
commit 0dc3e054d6
3 changed files with 51 additions and 0 deletions

17
src/_layouts/blog.njk Normal file
View file

@ -0,0 +1,17 @@
---
layout: base
---
<header>
<section>
<h1>{{ title }}</h1>
</section>
</header>
<article>
{{ content | safe }}
{% set postslist = collections.posts %} {% include "partials/posts.njk" %}
</article>

23
src/_layouts/home.njk Normal file
View file

@ -0,0 +1,23 @@
---
layout: base
---
<header>
<h1>{{ title }}</h1>
</header>
<article>
{{ content | safe }}
</article>
<article>
<h2>{{ blog.title }}</h2>
<!-- blog intro text is optional. -->
{% if blog.intro %}
<p>{{ blog.intro }}</p>
{% endif %}
</div>
{% set postslist = collections.posts.slice(0, 4) %} {% include "partials/posts.njk" %}
</article>

11
src/_layouts/post.njk Normal file
View file

@ -0,0 +1,11 @@
---
layout: base
---
<article>
<h1>{{ title }}</h1>
{% set definedDate = date %} {% include "partials/date.njk" %}
{{ content | safe }}
</article>