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

@ -1,6 +1,6 @@
---
pagination:
data: collections.postsByTag
data: collections.contentByTag
size: 1
alias: tag
addAllPagesToCollections: true
@ -8,10 +8,14 @@ permalink: /tags/{{ tag }}/
layout: base.njk
---
<h1>Posts tagged "#{{ collections.postsByTag[tag].name }}"</h1>
<h1>Content tagged "#{{ collections.contentByTag[tag].name }}"</h1>
{% set tagData = collections.contentByTag[tag] %}
{% if tagData.posts.length > 0 %}
<h2>Posts</h2>
<ul class="post-list">
{% for post in collections.postsByTag[tag].posts %}
{% for post in tagData.posts %}
<li>
<a href="{{ post.url }}" class="post-card">
<h2>{{ post.data.title }}</h2>
@ -23,5 +27,22 @@ layout: base.njk
</li>
{% endfor %}
</ul>
{% endif %}
<p><a href="/tags/"><3E> All tags</a></p>
{% if tagData.recipes.length > 0 %}
<h2>Recipes</h2>
<ul class="post-list">
{% for recipe in tagData.recipes %}
<li>
<a href="/recipe/{{ recipe.data.recipeSlug }}/" class="post-card">
<h2>{{ recipe.data.title }}</h2>
{% if recipe.data.description %}
<p>{{ recipe.data.description }}</p>
{% endif %}
</a>
</li>
{% endfor %}
</ul>
{% endif %}
<p><a href="/tags/">← All tags</a></p>