add recipe support

main
Síle Ekaterin Liszka 2022-11-12 13:05:22 -08:00
parent 3de41cf56e
commit c0a92aac5c
2 changed files with 34 additions and 0 deletions

18
archetypes/recipe.md Normal file
View File

@ -0,0 +1,18 @@
---
draft: true
title: "{{ replace .Name "-" " " | title }}"
tags: []
servings: 4
# in minutes
prep_time: 15
cook_time: 15
cook: true
recipes:
- name: sauce
ingredients:
- 2tbsps flour
- 2tbsps butter
- name: dish
ingredients:
- 1lb sirloin
---

View File

@ -0,0 +1,16 @@
{{ define "main" }}
<h1>{{.Title}}</h1>
{{ range .Recipes }}
<section class="recipe">
<h2>{{.Name}}</h2>
<p><b>Ingredients:</b></p>
<ul>{{ range .Ingredients }}
<li>{{.}}</li>{{ end }}
</ul>
<p><b>Directions:</b></p>
<ol>{{ range .Directions }}
<li>{{.}}</li>{{ end }}
</ol>
</section>
{{ end }}
{{ end }}