53 lines
No EOL
1.3 KiB
Text
53 lines
No EOL
1.3 KiB
Text
---
|
|
layout: base.njk
|
|
title: Blog
|
|
description: Welcome to my website! I write about tech, politics, food, and hobby projects. Stay a while, make some friends, learn something, and help your neighbors.
|
|
---
|
|
|
|
<section class="intro">
|
|
<p>{{ description }}</p>
|
|
</section>
|
|
|
|
{% if collections.posts.length > 0 %}
|
|
<h1>Blog Posts</h1>
|
|
|
|
<ul class="post-list">
|
|
{% for post in collections.posts %}
|
|
<li>
|
|
<a href="{{ post.url }}" class="post-card">
|
|
<h2>{{ post.data.title }}</h2>
|
|
<time datetime="{{ post.data.createdAt | dateTimeFormat }}">{{ post.data.createdAt | dateTimeFormat }}</time>
|
|
{% if post.data.description %}
|
|
<p>{{ post.data.description }}</p>
|
|
{% endif %}
|
|
</a>
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
{% endif %}
|
|
|
|
{% set hasRecipes = false %}
|
|
{% for slug, recipeData in collections.recipesBySlug %}
|
|
{% if recipeData.newest %}
|
|
{% set hasRecipes = true %}
|
|
{% endif %}
|
|
{% endfor %}
|
|
|
|
{% if hasRecipes %}
|
|
<h1>Recipes</h1>
|
|
|
|
<ul class="post-list">
|
|
{% for slug, recipeData in collections.recipesBySlug %}
|
|
{% if recipeData.newest %}
|
|
<li>
|
|
<a href="/recipe/{{ slug }}/" class="post-card">
|
|
<h2>{{ recipeData.newest.data.title }}</h2>
|
|
{% if recipeData.newest.data.description %}
|
|
<p>{{ recipeData.newest.data.description }}</p>
|
|
{% endif %}
|
|
</a>
|
|
</li>
|
|
{% endif %}
|
|
{% endfor %}
|
|
</ul>
|
|
{% endif %} |