feat: created recipes structure

This commit is contained in:
Leyla Becker 2026-02-12 14:57:57 -06:00
parent a035c08249
commit f93207b4e3
7 changed files with 432 additions and 13 deletions

View file

@ -8,6 +8,7 @@ description: Welcome to my website! I write about tech, politics, food, and hobb
<p>{{ description }}</p>
</section>
{% if collections.posts.length > 0 %}
<h1>Blog Posts</h1>
<ul class="post-list">
@ -23,7 +24,30 @@ description: Welcome to my website! I write about tech, politics, food, and hobb
</li>
{% endfor %}
</ul>
{% endif %}
{% if collections.posts.length == 0 %}
<p>No blog posts yet.</p>
{% 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 %}