feat: created index pages for posts and recipes

This commit is contained in:
Leyla Becker 2026-02-12 15:10:58 -06:00
parent f93207b4e3
commit 0d5bb62775
4 changed files with 110 additions and 16 deletions

34
recipes-index.njk Normal file
View file

@ -0,0 +1,34 @@
---
layout: base.njk
title: All Recipes
description: All recipes on Volpe.
permalink: /recipes/
---
<h1>Recipes</h1>
{% set hasRecipes = false %}
{% for slug, recipeData in collections.recipesBySlug %}
{% if recipeData.newest %}
{% set hasRecipes = true %}
{% endif %}
{% endfor %}
{% if hasRecipes %}
<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>
{% else %}
<p>No recipes yet.</p>
{% endif %}