add sub/recipe layouts to _config.yml to avoid repititious repitition

This commit is contained in:
Lynne Megido 2020-03-01 07:14:38 +10:00
parent 44cfec0496
commit 9e5299377a
Signed by: lynnesbian
GPG Key ID: F0A184B5213D9F90
2 changed files with 10 additions and 3 deletions

View File

@ -32,7 +32,6 @@ Here's an example recipe, which could be saved to `_recipes/chocolate_cake.yml`:
---
name: Chocolate cake
author: Jane Crocker
layout: recipe
ingredients:
- [1, egg, null]
@ -48,7 +47,6 @@ time: 240
```
- `name` (string) - The displayed name of the recipe. Does not appear in the URL.
- `author` (string, optional) - The author of the recipe.
- `layout` (string) - The template to use; should always be `recipe`.
- `ingredients` (list) - Each entry in `ingredients` consists of an amount, ingredient name, and unit terminology. `[2, flour, cups]` is displayed as `2 cups of flour`, while `[1, egg, null]` is displayed as `1 egg`. The third field is optional - `[1, egg, null]` is the same as `[1, egg]`.
- `method` (list) - A list of steps undertaken to create the recipe, written in plain English. Or whatever language you prefer.
- `time` (string, optional) - The time it takes to make the recipe in minutes.
@ -72,7 +70,6 @@ name: Example
Subrecipes behave a little differently to regular recipes:
- They don't show up on the home page
- The `time` tag is not supported
- `layout` should be `subrecipe`
Subrecipes have a tag that regular recipes do not - the `parents` tag. This is a list of recipes that the subrecipe should be included in. For example:
```yaml

View File

@ -1,3 +1,13 @@
defaults:
- scope:
path: "_recipes"
values:
layout: "recipe"
- scope:
path: "_subrecipes"
values:
layout: "subrecipe"
collections:
# note: subrecipes MUST come before recipes, otherwise subrecipe.output will be empty with no error message given. thanks to https://github.com/jekyll/jekyll/issues/5371#issuecomment-247951926
subrecipes: