Compare commits

..

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

6 changed files with 10 additions and 117 deletions

View File

@ -47,11 +47,7 @@ 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]`.
- 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`.
- `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.

View File

@ -3,8 +3,8 @@
{%- assign tag = "h4" -%}
{%- endif -%}
<{{tag}}>Ingredients</{{tag}}>
<ul class='ingredients'>
<ul>
{% 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>
<li>{{ item[0] }} {%- if item[2] %} {{ item[2] }} of {% endif -%} {{ item[1] }}</li>
{% endfor -%}
</ul>

View File

@ -1,18 +1,5 @@
<div id='recipes'>
<ul>
{% for recipe in site.recipes -%}
<a href='{{ recipe.url }}' class='recipe-listing'>
<h2>{{ recipe.name }}</h2>
<p>
By {{ recipe.author }} - {{ recipe.method | size }} steps -
{%- if recipe.time > 59 %} {{ recipe.time | divided_by: 60}}h {% endif -%}
{% assign mins = recipe.time | modulo: 60 -%}
{%- if mins > 0 %}{{ mins }}m{% endif %}
</p>
<ol class='excerpt'>
{% for step in recipe.method | limit: 4 %}
<li>{{ step }}</li>
{% endfor %}
</ol>
</a>
<li><a href='{{ recipe.url }}'>{{ recipe.name }}</a></li>
{% endfor %}
</div>
</ul>

View File

@ -9,7 +9,7 @@
</head>
<body>
<div id='main'>
<div>
{{ content }}
</div>

View File

@ -2,6 +2,4 @@
title: Home
layout: default
---
<h1>Home</h1>
<p>Currently tracking {{ site.recipes.size }} recipes and {{ site.subrecipes.size }} subrecipes.</p>
{% include recipes.html %}

View File

@ -1,53 +1,17 @@
html {
overflow-y: scroll; /* force scrollbar to appear to stop elements jumping around when the scrollbar appears naturally */
}
body {
font-family: "DejaVu Sans", "Bitstream Vera Sans", "Helvetica", "Roboto", sans-serif;
display: flex;
flex-direction: column;
min-height: 100vh;
background: #fafafa;
margin: 0;
}
#main {
body div {
flex-grow: 1;
}
h1 {
margin: 0;
padding: 20px 0;
text-align: center;
background: linear-gradient(to right, turquoise, transparent 80%);
}
h2 {
padding-left: 10px;
background: linear-gradient(to right, turquoise 5px, transparent 5px 100%);
}
h1, h2, h3, h4, h5, h6 {
font-weight: 400;
}
h3 {
font-size: 1.3em;
}
h4 {
font-size: 1.2em;
margin: 0.75em 0;
}
.ingredients li.optional::before {
content: "(Optional) ";
font-style: italic;
}
.subrecipe {
background: #eee;
padding: 10px;
border-radius: 10px;
}
.subrecipe, p {
margin-left: 10px;
margin-right: 10px;
padding: 5px;
}
.subrecipe h3 {
margin: 0;
@ -69,8 +33,6 @@ h4 {
}
.subrecipe-toggle::after {
font-style: italic;
font-size: 0.75em;
vertical-align: text-top;
}
.subrecipe .subrecipe-toggle::after {
content: "Show";
@ -79,14 +41,6 @@ h4 {
content: "Hide";
}
a {
color: turquoise;
text-decoration: none;
}
a:not(.recipe-listing):hover {
text-decoration: underline;
}
ul {
list-style-type: "- ";
}
@ -95,51 +49,9 @@ ul, ol {
padding-left: 10px;
}
#recipes {
display: flex;
flex-flow: row wrap;
}
.recipe-listing {
display: block;
margin: 10px;
padding: 5px;
border-radius: 10px;
background: linear-gradient(to right, turquoise 5px, #eee 5px 100%);
max-width: 600px;
flex: 1 0 300px;
}
a.recipe-listing {
color: black;
}
.recipe-listing h2 {
background: none;
}
.excerpt {
color: grey;
position: relative;
margin-bottom: 0;
}
.excerpt::after {
top: 0;
left: 0;
right: 0;
bottom: 0;
content: "";
position: absolute;
font-size: 1em;
background: linear-gradient(to top, #eee 1em, transparent);
}
footer {
text-align: center;
background: #333;
display: block;
width: 100%;
padding: 20px 0;
margin: 0;
margin: 20px auto;
}
footer, .subtle {
color: grey;