Compare commits
3 commits
65e22291ea
...
7d11e7a57d
Author | SHA1 | Date | |
---|---|---|---|
7d11e7a57d | |||
1e5097e732 | |||
77c15fa1b9 |
6 changed files with 34 additions and 9 deletions
|
@ -27,7 +27,7 @@ However, there won't be much to look at until you add some recipes!
|
|||
## Recipe file format
|
||||
Recipes are found in `_recipes/`, with subrecipes located in `_subrecipes/`.
|
||||
|
||||
Here's an example recipe, which could be saved to `_recipes/chocolate_cake.yml`:
|
||||
Here's an example recipe, which could be saved to `_recipes/chocolate_cake.md`:
|
||||
```yaml
|
||||
---
|
||||
name: Chocolate cake
|
||||
|
@ -48,7 +48,9 @@ time: 240
|
|||
- `name` (string) - The displayed name of the recipe. Does not appear in the URL.
|
||||
- `author` (string, optional) - The author of the recipe.
|
||||
- `ingredients` (list) - Each entry in `ingredients` is an array consisting of up to four items:
|
||||
- amount (number or array) - The amount of this item to add, e.g. `2` for 2 cups of flour. If this is `0`, the output will be e.g. "jalepeño chillis to taste" rather than "0 jalepeño chillis". If this in an array, it will be printed as `amount[0] to amount[1]`. For example, if you wanted to say "2 to 3 cups of peas", you would write `[[2, 3], peas, cups]`.
|
||||
- amount (number or array) - The amount of this item to add, e.g. `2` for 2 cups of flour.
|
||||
- If this is `0`, the output will be e.g. "jalepeño chillis to taste" rather than "0 jalepeño chillis".
|
||||
- If this in an array, it will be printed as `amount[0] to amount[1]`. For example, if you wanted to say "2 to 3 cups of peas", you would write `[[2, 3], peas, cups]`.
|
||||
- ingredient name (string) - The name of the ingredient, e.g. `flour` for 2 cups of flour.
|
||||
- unit terminology (string, optional) - The unit that amount refers to, e.g. `cups` for 2 cups of flour. If left blank or null, as in `[1, egg]`, the output will simply be "1 egg".
|
||||
- optional (boolean, optional) - Whether or not this ingredient is optional. The ingredient `[1, chocolate egg, null, true]` produces "1 chocolate egg" and marks is as optional. Defaults to `false`.
|
||||
|
@ -57,7 +59,7 @@ time: 240
|
|||
|
||||
The recipe's file name isn't important, but it's good practice to make it something obvious, like `chocolate_cake.md` and not `strawberry_pie.md`.
|
||||
|
||||
The recipe files are standard YAML. Every recipe **must** begin and end with three dashes [to ensure that Jekyll processes it](https://jekyllrb.com/docs/front-matter/).
|
||||
The recipe files are standard YAML. Every recipe **must** begin and end with three dashes [to ensure that Jekyll processes it](https://jekyllrb.com/docs/front-matter/). Jekyll only processes files with certain extensions. Even though the recipes are formatted as YAML, they can't be saved as `.yml` or `.yaml` files - they must be saved with an extension that Jekyll will process, like `.md` or `.html`.
|
||||
|
||||
Good:
|
||||
```yaml
|
||||
|
|
|
@ -5,6 +5,20 @@
|
|||
<{{tag}}>Ingredients</{{tag}}>
|
||||
<ul class='ingredients'>
|
||||
{% for item in page.ingredients -%}
|
||||
<li class='{% if item[3] %}optional{% endif %}'>{% if item[0] != 0 %}{% if item[0][0] %}{{ item[0][0] }} to {{ item[0][1] }}{% else %}{{ item[0] }}{% endif %}{% endif %} {%- if item[2] %} {{ item[2] }} of {%- endif %} {{ item[1] }}{% if item[0] == 0 %} to taste{% endif %}</li>
|
||||
{% endfor -%}
|
||||
{%- assign tag = "li" -%}
|
||||
{%- if item[3] -%}
|
||||
{%- assign tag = tag | append: " class='optional'" -%}
|
||||
{%- endif -%}
|
||||
|
||||
{%- assign amount = item[0] | append: " " -%}
|
||||
{%- assign end = "" -%}
|
||||
{%- if item[0][0] -%}
|
||||
{%- assign amount = item[0][0] | append: " to " | append: item[0][1] | append: " " -%}
|
||||
{%- elsif item[0] == 0 -%}
|
||||
{%- assign amount = "" -%}
|
||||
{%- assign end = " to taste" -%}
|
||||
{%- endif -%}
|
||||
|
||||
<{{ tag }}>{{ amount }} {%- if item[2] %}{{ item[2] }} of {% endif -%} {{ item[1] }}{{ end }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
|
|
@ -7,6 +7,6 @@
|
|||
<ol>
|
||||
{% for item in page.method -%}
|
||||
<li>{{ item }}</li>
|
||||
{% endfor -%}
|
||||
{% endfor %}
|
||||
</ol>
|
||||
{%- endif -%}
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<link rel='stylesheet' href='/style.css'>
|
||||
<script async src='/script.js'></script>
|
||||
<link rel='stylesheet' href='/assets/style.css'>
|
||||
<script async src='/assets/script.js'></script>
|
||||
<title>{{ page.title }}</title>
|
||||
</head>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
|||
{{ content }}
|
||||
</div>
|
||||
|
||||
{%- include footer.html -%}
|
||||
{% include footer.html -%}
|
||||
|
||||
</body>
|
||||
|
||||
|
|
|
@ -94,6 +94,9 @@ ul, ol {
|
|||
list-style-position: inside;
|
||||
padding-left: 10px;
|
||||
}
|
||||
li {
|
||||
padding: 1px 0;
|
||||
}
|
||||
|
||||
#recipes {
|
||||
display: flex;
|
||||
|
@ -108,6 +111,12 @@ ul, ol {
|
|||
background: linear-gradient(to right, turquoise 5px, #eee 5px 100%);
|
||||
max-width: 600px;
|
||||
flex: 1 0 300px;
|
||||
box-shadow: 0 0 3px #0003;
|
||||
transition: 0.2s all;
|
||||
|
||||
}
|
||||
.recipe-listing:hover {
|
||||
box-shadow: 0 0 15px #0003;
|
||||
}
|
||||
a.recipe-listing {
|
||||
color: black;
|
Loading…
Reference in a new issue