add sub/recipe layouts to _config.yml to avoid repititious repitition
This commit is contained in:
parent
44cfec0496
commit
9e5299377a
2 changed files with 10 additions and 3 deletions
|
@ -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
|
||||
|
|
10
_config.yml
10
_config.yml
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue