Greatly simplified the looping logic by removing an unnessary array
level from the menu YAML
This commit is contained in:
parent
80190a3669
commit
22f7f6908c
18
build.py
18
build.py
@ -13,14 +13,15 @@ with open('menu.yaml', 'r') as file:
|
|||||||
templateMenu = env.get_template("menu.html")
|
templateMenu = env.get_template("menu.html")
|
||||||
templateRecipes = env.get_template("recipes.html")
|
templateRecipes = env.get_template("recipes.html")
|
||||||
|
|
||||||
for bev in menu['menu']:
|
print(menu)
|
||||||
|
|
||||||
|
for bev, details in menu['menu'].items():
|
||||||
#print(bev)
|
#print(bev)
|
||||||
for name in bev:
|
print(bev)
|
||||||
print(name)
|
for ingredient in details['ingredients']:
|
||||||
for ingredient in bev[name]['ingredients']:
|
print(f'<li>{ingredient[list(ingredient)[0]]} {list(ingredient)[0]}</li>')
|
||||||
print(f'<li>{ingredient[list(ingredient)[0]]} {list(ingredient)[0]}</li>')
|
print(markdown.markdown(details['directions']))
|
||||||
print(markdown.markdown(bev[name]['directions']))
|
details['directions_html'] = markdown.markdown(details['directions'])
|
||||||
bev[name]['directions_html'] = markdown.markdown(bev[name]['directions'])
|
|
||||||
|
|
||||||
with open('index.html', 'w') as file:
|
with open('index.html', 'w') as file:
|
||||||
file.write(templateMenu.render(bevs = menu['menu']))
|
file.write(templateMenu.render(bevs = menu['menu']))
|
||||||
@ -28,8 +29,5 @@ with open('index.html', 'w') as file:
|
|||||||
with open('recipes.html', 'w') as file:
|
with open('recipes.html', 'w') as file:
|
||||||
file.write(templateRecipes.render(bevs = menu['menu']))
|
file.write(templateRecipes.render(bevs = menu['menu']))
|
||||||
|
|
||||||
print(menu['menu'])
|
|
||||||
|
|
||||||
|
|
||||||
for ingredient in menu['out_of_stock']:
|
for ingredient in menu['out_of_stock']:
|
||||||
print(ingredient)
|
print(ingredient)
|
||||||
|
|||||||
164
menu.yaml
164
menu.yaml
@ -1,87 +1,87 @@
|
|||||||
---
|
---
|
||||||
menu:
|
menu:
|
||||||
- Old Fashioned:
|
Old Fashioned:
|
||||||
base: Bourbon
|
base: Bourbon
|
||||||
category: Ancestrals
|
category: Ancestrals
|
||||||
ingredients:
|
ingredients:
|
||||||
- Bourbon: 2 oz
|
- Bourbon: 2 oz
|
||||||
- Maple syrup: 1tsp
|
- Maple syrup: 1tsp
|
||||||
- Angostura bitters: 2 dashes
|
- Angostura bitters: 2 dashes
|
||||||
directions: |
|
directions: |
|
||||||
1. Stir with ice. Strain into rocks glass over large cube.
|
1. Stir with ice. Strain into rocks glass over large cube.
|
||||||
1. Garnish with orange twist.
|
1. Garnish with orange twist.
|
||||||
- Boulevardier:
|
Boulevardier:
|
||||||
base: Bourbon
|
base: Bourbon
|
||||||
category: Spirit-Forward
|
category: Spirit-Forward
|
||||||
ingredients:
|
ingredients:
|
||||||
- Bourbon: 1.5 oz
|
- Bourbon: 1.5 oz
|
||||||
- Campari: 1 oz
|
- Campari: 1 oz
|
||||||
- Sweet vermouth: 1 oz
|
- Sweet vermouth: 1 oz
|
||||||
directions: |
|
directions: |
|
||||||
1. Stir with ice. Strain into rocks glass over large cube.
|
1. Stir with ice. Strain into rocks glass over large cube.
|
||||||
1. Garnish with orange twist.
|
1. Garnish with orange twist.
|
||||||
- Black Manhattan:
|
Black Manhattan:
|
||||||
base: Rye whiskey
|
base: Rye whiskey
|
||||||
category: Spirit-Forward
|
category: Spirit-Forward
|
||||||
ingredients:
|
ingredients:
|
||||||
- Rye whiskey: 2 oz
|
- Rye whiskey: 2 oz
|
||||||
- Amaro: 1 oz
|
- Amaro: 1 oz
|
||||||
- Angostura bitters: 1 dash
|
- Angostura bitters: 1 dash
|
||||||
- Orange bitters: 1 dash
|
- Orange bitters: 1 dash
|
||||||
directions: |
|
directions: |
|
||||||
1. Stir with ice. Strain into chilled coupe.
|
1. Stir with ice. Strain into chilled coupe.
|
||||||
1. Garnish with orange twist.
|
1. Garnish with orange twist.
|
||||||
- MonteNegroni:
|
MonteNegroni:
|
||||||
base: Amaro Montenegro & Gin
|
base: Amaro Montenegro & Gin
|
||||||
category:
|
category:
|
||||||
ingredients:
|
ingredients:
|
||||||
- Amaro Montenegro: 1 1/3 oz
|
- Amaro Montenegro: 1 1/3 oz
|
||||||
- Gin: 2/3 oz
|
- Gin: 2/3 oz
|
||||||
- Sweet vermouth: 2/3 oz
|
- Sweet vermouth: 2/3 oz
|
||||||
- Angostura bitters: 2 drops
|
- Angostura bitters: 2 drops
|
||||||
directions: |
|
directions: |
|
||||||
1. Stir with ice. Strain into rocks glass over large cube.
|
1. Stir with ice. Strain into rocks glass over large cube.
|
||||||
1. Garnish with orange twist.
|
1. Garnish with orange twist.
|
||||||
- Sidecar:
|
Sidecar:
|
||||||
base: Bourbon
|
base: Bourbon
|
||||||
category: Sours
|
category: Sours
|
||||||
ingredients:
|
ingredients:
|
||||||
- Bourbon: 2 oz
|
- Bourbon: 2 oz
|
||||||
- Cointreau: 1 oz
|
- Cointreau: 1 oz
|
||||||
- Lemon juice: 0.5 oz
|
- Lemon juice: 0.5 oz
|
||||||
directions: |
|
directions: |
|
||||||
1. Shake with ice. Double strain into chilled coupe.
|
1. Shake with ice. Double strain into chilled coupe.
|
||||||
- "Gin & Tonic":
|
"Gin & Tonic":
|
||||||
base: Gin
|
base: Gin
|
||||||
category: Highballs
|
category: Highballs
|
||||||
ingredients:
|
ingredients:
|
||||||
- Gin: 2 oz
|
- Gin: 2 oz
|
||||||
- Tonic water: 4 oz
|
- Tonic water: 4 oz
|
||||||
directions: |
|
directions: |
|
||||||
1. Pour gin and tonic over ice in short glass.
|
1. Pour gin and tonic over ice in short glass.
|
||||||
1. Stir gently.
|
1. Stir gently.
|
||||||
1. Garnish with lime wheel.
|
1. Garnish with lime wheel.
|
||||||
- Gimlet:
|
Gimlet:
|
||||||
base: Gin
|
base: Gin
|
||||||
category: Sours
|
category: Sours
|
||||||
ingredients:
|
ingredients:
|
||||||
- Gin: 2 oz
|
- Gin: 2 oz
|
||||||
- Lime juice: 1 oz
|
- Lime juice: 1 oz
|
||||||
- Simple syrup: 0.5 oz
|
- Simple syrup: 0.5 oz
|
||||||
directions: |
|
directions: |
|
||||||
1. Shake with ice.
|
1. Shake with ice.
|
||||||
1. Double strain into chilled coupe.
|
1. Double strain into chilled coupe.
|
||||||
- Bennet:
|
Bennet:
|
||||||
base: Gin
|
base: Gin
|
||||||
category: Sours
|
category: Sours
|
||||||
ingredients:
|
ingredients:
|
||||||
- Gin: 2 oz
|
- Gin: 2 oz
|
||||||
- Lime juice: 1 oz
|
- Lime juice: 1 oz
|
||||||
- Simple syrup: 0.5 oz
|
- Simple syrup: 0.5 oz
|
||||||
- Angostura bitters: 1 dash
|
- Angostura bitters: 1 dash
|
||||||
directions: |
|
directions: |
|
||||||
1. Shake with ice.
|
1. Shake with ice.
|
||||||
1. Double strain into chilled coupe.
|
1. Double strain into chilled coupe.
|
||||||
|
|
||||||
out_of_stock:
|
out_of_stock:
|
||||||
- Rye whiskey
|
- Rye whiskey
|
||||||
|
|||||||
@ -3,8 +3,7 @@
|
|||||||
{% block bodyclass %}menu{% endblock %}
|
{% block bodyclass %}menu{% endblock %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>{% block header %}Cocktails{% endblock %}</h1>
|
<h1>{% block header %}Cocktails{% endblock %}</h1>
|
||||||
{% for bev in bevs %}
|
{% for name, details in bevs.items() %}
|
||||||
{% for name, details in bev.items() %}
|
|
||||||
<h2>{{ name }}</h2>
|
<h2>{{ name }}</h2>
|
||||||
<ul>
|
<ul>
|
||||||
{% for ingredient in details['ingredients'] %}
|
{% for ingredient in details['ingredients'] %}
|
||||||
@ -15,5 +14,4 @@
|
|||||||
</ul>
|
</ul>
|
||||||
{% block directions scoped %}{% endblock %}
|
{% block directions scoped %}{% endblock %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endfor %}
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user