Compare commits

..

No commits in common. "7d11e7a57d035df68440b9702b7d2f7a1720d435" and "65e22291ea2d4b00b57de8ef1a49c0f970984080" have entirely different histories.

6 changed files with 9 additions and 34 deletions

View file

@ -27,7 +27,7 @@ However, there won't be much to look at until you add some recipes!
## Recipe file format ## Recipe file format
Recipes are found in `_recipes/`, with subrecipes located in `_subrecipes/`. Recipes are found in `_recipes/`, with subrecipes located in `_subrecipes/`.
Here's an example recipe, which could be saved to `_recipes/chocolate_cake.md`: Here's an example recipe, which could be saved to `_recipes/chocolate_cake.yml`:
```yaml ```yaml
--- ---
name: Chocolate cake name: Chocolate cake
@ -48,9 +48,7 @@ time: 240
- `name` (string) - The displayed name of the recipe. Does not appear in the URL. - `name` (string) - The displayed name of the recipe. Does not appear in the URL.
- `author` (string, optional) - The author of the recipe. - `author` (string, optional) - The author of the recipe.
- `ingredients` (list) - Each entry in `ingredients` is an array consisting of up to four items: - `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. - 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]`.
- 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. - 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". - 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`. - 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`.
@ -59,7 +57,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'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/). 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`. 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/).
Good: Good:
```yaml ```yaml

View file

@ -5,20 +5,6 @@
<{{tag}}>Ingredients</{{tag}}> <{{tag}}>Ingredients</{{tag}}>
<ul class='ingredients'> <ul class='ingredients'>
{% for item in page.ingredients -%} {% for item in page.ingredients -%}
{%- assign tag = "li" -%} <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>
{%- if item[3] -%} {% endfor -%}
{%- 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> </ul>

View file

@ -7,6 +7,6 @@
<ol> <ol>
{% for item in page.method -%} {% for item in page.method -%}
<li>{{ item }}</li> <li>{{ item }}</li>
{% endfor %} {% endfor -%}
</ol> </ol>
{%- endif -%} {%- endif -%}

View file

@ -3,8 +3,8 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<link rel='stylesheet' href='/assets/style.css'> <link rel='stylesheet' href='/style.css'>
<script async src='/assets/script.js'></script> <script async src='/script.js'></script>
<title>{{ page.title }}</title> <title>{{ page.title }}</title>
</head> </head>
@ -13,7 +13,7 @@
{{ content }} {{ content }}
</div> </div>
{% include footer.html -%} {%- include footer.html -%}
</body> </body>

View file

@ -94,9 +94,6 @@ ul, ol {
list-style-position: inside; list-style-position: inside;
padding-left: 10px; padding-left: 10px;
} }
li {
padding: 1px 0;
}
#recipes { #recipes {
display: flex; display: flex;
@ -111,12 +108,6 @@ li {
background: linear-gradient(to right, turquoise 5px, #eee 5px 100%); background: linear-gradient(to right, turquoise 5px, #eee 5px 100%);
max-width: 600px; max-width: 600px;
flex: 1 0 300px; 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 { a.recipe-listing {
color: black; color: black;