Compare commits

..

No commits in common. "94c46143a9ffe180f551b0f70135190250974cac" and "75e97b9d4a56ebe20ef64ccb4913af993dc92453" have entirely different histories.

10 changed files with 528 additions and 197 deletions

1
.gitignore vendored
View File

@ -1 +0,0 @@
*.html

View File

@ -1,18 +0,0 @@
FROM python:3.12
WORKDIR /usr/local/app
# Install the application dependencies
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
# Copy in the source code
COPY . .
EXPOSE 5000
# Setup an app user so the container doesn't run as the root user
RUN useradd app
USER app
CMD ["cd", "/usr/local/app"]
CMD "ls"
CMD ["flask", "--app", "build", "run", "--host=0.0.0.0"]]

View File

@ -7,51 +7,29 @@ env = Environment(
autoescape=select_autoescape() autoescape=select_autoescape()
) )
def generateMenu(): with open('menu.yaml', 'r') as file:
with open('menu.yaml', 'r') as file: menu = yaml.safe_load(file)
menu = yaml.safe_load(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, details in menu['menu'].items(): for bev in menu['menu']:
#print(bev) #print(bev)
print(bev) for name in bev:
#for ingredient in details['ingredients']: print(name)
# print(f'<li>{ingredient[list(ingredient)[0]]} {list(ingredient)[0]}</li>') for ingredient in bev[name]['ingredients']:
details['directions_html'] = markdown.markdown(details['directions']) print(f'<li>{ingredient[list(ingredient)[0]]} {list(ingredient)[0]}</li>')
print(markdown.markdown(bev[name]['directions']))
bev[name]['directions_html'] = markdown.markdown(bev[name]['directions'])
menuHtml = templateMenu.render(bevs = menu['menu']) with open('index.html', 'w') as file:
recipesHtml = templateRecipes.render(bevs = menu['menu']) file.write(templateMenu.render(bevs = menu['menu']))
return {'menuHtml': menuHtml, 'recipesHtml': recipesHtml}
if (__name__ == 'build'): with open('recipes.html', 'w') as file:
from flask import Flask file.write(templateRecipes.render(bevs = menu['menu']))
app = Flask(__name__) print(menu['menu'])
@app.route("/")
def serveMenu():
return generateMenu()['menuHtml']
@app.route("/recipes")
def serveRecipes():
return generateMenu()['recipesHtml']
elif (__name__ == '__main__'):
html = generateMenu()
with open('index.html', 'w') as file:
file.write(html['menuHtml'])
with open('recipes.html', 'w') as file:
file.write(html['recipesHtml'])
print(generateMenu()) for ingredient in menu['out_of_stock']:
#print(menu) print(ingredient)
#
#
#
#for ingredient in menu['out_of_stock']:
# print(ingredient)
#
#print(__name__)

183
index.html Normal file
View File

@ -0,0 +1,183 @@
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="style.css">
<title>Cocktail Menu</title>
</head>
<body class="menu">
<main>
<h1>Cocktails</h1>
<h2>Old Fashioned</h2>
<ul>
<li>Bourbon</li>
<li>Maple syrup</li>
<li>Angostura bitters</li>
</ul>
<h2>Boulevardier</h2>
<ul>
<li>Bourbon</li>
<li>Campari</li>
<li>Sweet vermouth</li>
</ul>
<h2>Black Manhattan</h2>
<ul>
<li>Rye whiskey</li>
<li>Amaro</li>
<li>Angostura bitters</li>
<li>Orange bitters</li>
</ul>
<h2>MonteNegroni</h2>
<ul>
<li>Amaro Montenegro</li>
<li>Gin</li>
<li>Sweet vermouth</li>
<li>Angostura bitters</li>
</ul>
<h2>Sidecar</h2>
<ul>
<li>Bourbon</li>
<li>Cointreau</li>
<li>Lemon juice</li>
</ul>
<h2>Gin &amp; Tonic</h2>
<ul>
<li>Gin</li>
<li>Tonic water</li>
</ul>
<h2>Gimlet</h2>
<ul>
<li>Gin</li>
<li>Lime juice</li>
<li>Simple syrup</li>
</ul>
<h2>Bennet</h2>
<ul>
<li>Gin</li>
<li>Lime juice</li>
<li>Simple syrup</li>
<li>Angostura bitters</li>
</ul>
</main>
</body>
</html>

199
menu.yaml
View File

@ -1,122 +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.
Manhattan: - Black Manhattan:
base: Bourbon base: Rye whiskey
category: Ancestrals category: Spirit-Forward
ingredients: ingredients:
Bourbon: 1.5 oz - Rye whiskey: 2 oz
Sweet vermouth: 1 oz - Amaro: 1 oz
Angostura bitters: 2 dashes - Angostura bitters: 1 dash
directions: | - Orange bitters: 1 dash
1. Stir with ice. directions: |
2. Strain into chilled coupe. 1. Stir with ice. Strain into chilled coupe.
3. Garnish with cherry or orange twist. 1. Garnish with orange twist.
Black Manhattan: - MonteNegroni:
base: Rye whiskey base: Amaro Montenegro & Gin
category: Spirit-Forward category:
ingredients: ingredients:
Rye whiskey: 2 oz - Amaro Montenegro: 1 1/3 oz
Amaro: 1 oz - Gin: 2/3 oz
Angostura bitters: 1 dash - Sweet vermouth: 2/3 oz
Orange bitters: 1 dash - Angostura bitters: 2 drops
directions: | directions: |
1. Stir with ice. Strain into chilled coupe. 1. Stir with ice. Strain into rocks glass over large cube.
1. Garnish with orange twist. 1. Garnish with orange twist.
MonteNegroni: - Sidecar:
base: Amaro Montenegro & Gin base: Bourbon
category: category: Sours
ingredients: ingredients:
Amaro Montenegro: 1 1/3 oz - Bourbon: 2 oz
Gin: 2/3 oz - Cointreau: 1 oz
Sweet vermouth: 2/3 oz - Lemon juice: 0.5 oz
Angostura bitters: 2 drops directions: |
directions: | 1. Shake with ice. Double strain into chilled coupe.
1. Stir with ice. Strain into rocks glass over large cube. - "Gin & Tonic":
1. Garnish with orange twist. base: Gin
Sidecar: category: Highballs
base: Bourbon ingredients:
category: Sours - Gin: 2 oz
ingredients: - Tonic water: 4 oz
Bourbon: 2 oz directions: |
Cointreau: 1 oz 1. Pour gin and tonic over ice in short glass.
Lemon juice: 0.5 oz 1. Stir gently.
directions: | 1. Garnish with lime wheel.
1. Shake with ice. Double strain into chilled coupe. - Gimlet:
"Gin & Tonic": base: Gin
base: Gin category: Sours
category: Highballs ingredients:
ingredients: - Gin: 2 oz
Gin: 2 oz - Lime juice: 1 oz
Tonic water: 4 oz - Simple syrup: 0.5 oz
directions: | directions: |
1. Pour gin and tonic over ice in short glass. 1. Shake with ice.
1. Stir gently. 1. Double strain into chilled coupe.
1. Garnish with lime wheel. - Bennet:
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 - 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.
Bennet:
base: Gin
category: Sours
ingredients:
Gin: 2 oz
Lime juice: 1 oz
Simple syrup: 0.5 oz
Angostura bitters: 1 dash
directions: |
1. Shake with ice.
1. Double strain into chilled coupe.
Garibaldi:
base: Campari
category: Highballs
ingredients:
Campari: 1.5 oz
Orange juice: 4.5 oz
directions: |
1. Blend orange juice and Campari until frothy.
1. Strain into ice-filled highball.
White Russian:
base: Vodka
category:
ingredients:
Vodka: 1.5 oz
Kahlua: 1 oz
Heavy cream: 1 oz
Instant coffee: 0.5 tsp
directions: |
1. Chill vodka
1. Add large cube to lowball glass
1. Sprinkle instant coffee powder over ice
1. Slowly pour vodka around ice
1. Slowly pour Kahlua around ice
1. Slowly pour cream over ice
out_of_stock: out_of_stock:
- Rye whiskey - Rye whiskey

231
recipes.html Normal file
View File

@ -0,0 +1,231 @@
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="style.css">
<title>Cocktail Menu</title>
</head>
<body class="recipes">
<main>
<h1>Recipes</h1>
<h2>Old Fashioned</h2>
<ul>
<li>2 oz Bourbon</li>
<li>1tsp Maple syrup</li>
<li>2 dashes Angostura bitters</li>
</ul>
<h3>Directions</h3>
<p><ol>
<li>Stir with ice. Strain into rocks glass over large cube.</li>
<li>Garnish with orange twist.</li>
</ol></p>
<h2>Boulevardier</h2>
<ul>
<li>1.5 oz Bourbon</li>
<li>1 oz Campari</li>
<li>1 oz Sweet vermouth</li>
</ul>
<h3>Directions</h3>
<p><ol>
<li>Stir with ice. Strain into rocks glass over large cube.</li>
<li>Garnish with orange twist.</li>
</ol></p>
<h2>Black Manhattan</h2>
<ul>
<li>2 oz Rye whiskey</li>
<li>1 oz Amaro</li>
<li>1 dash Angostura bitters</li>
<li>1 dash Orange bitters</li>
</ul>
<h3>Directions</h3>
<p><ol>
<li>Stir with ice. Strain into chilled coupe.</li>
<li>Garnish with orange twist.</li>
</ol></p>
<h2>MonteNegroni</h2>
<ul>
<li>1 1/3 oz Amaro Montenegro</li>
<li>2/3 oz Gin</li>
<li>2/3 oz Sweet vermouth</li>
<li>2 drops Angostura bitters</li>
</ul>
<h3>Directions</h3>
<p><ol>
<li>Stir with ice. Strain into rocks glass over large cube.</li>
<li>Garnish with orange twist.</li>
</ol></p>
<h2>Sidecar</h2>
<ul>
<li>2 oz Bourbon</li>
<li>1 oz Cointreau</li>
<li>0.5 oz Lemon juice</li>
</ul>
<h3>Directions</h3>
<p><ol>
<li>Shake with ice. Double strain into chilled coupe.</li>
</ol></p>
<h2>Gin &amp; Tonic</h2>
<ul>
<li>2 oz Gin</li>
<li>4 oz Tonic water</li>
</ul>
<h3>Directions</h3>
<p><ol>
<li>Pour gin and tonic over ice in short glass.</li>
<li>Stir gently.</li>
<li>Garnish with lime wheel.</li>
</ol></p>
<h2>Gimlet</h2>
<ul>
<li>2 oz Gin</li>
<li>1 oz Lime juice</li>
<li>0.5 oz Simple syrup</li>
</ul>
<h3>Directions</h3>
<p><ol>
<li>Shake with ice.</li>
<li>Double strain into chilled coupe.</li>
</ol></p>
<h2>Bennet</h2>
<ul>
<li>2 oz Gin</li>
<li>1 oz Lime juice</li>
<li>0.5 oz Simple syrup</li>
<li>1 dash Angostura bitters</li>
</ul>
<h3>Directions</h3>
<p><ol>
<li>Shake with ice.</li>
<li>Double strain into chilled coupe.</li>
</ol></p>
</main>
</body>
</html>

View File

@ -1,11 +0,0 @@
blinker==1.9.0
click==8.1.8
Flask==3.1.0
importlib_metadata==8.6.1
itsdangerous==2.2.0
Jinja2==3.1.5
Markdown==3.7
MarkupSafe==3.0.2
PyYAML==6.0.2
Werkzeug==3.1.3
zipp==3.21.0

View File

@ -1,7 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<link rel="stylesheet" href="static/style.css"> <link rel="stylesheet" href="style.css">
<title>{% block title %}{% endblock %}</title> <title>{% block title %}{% endblock %}</title>
</head> </head>
<body class="{% block bodyclass %}{% endblock %}"> <body class="{% block bodyclass %}{% endblock %}">

View File

@ -3,13 +3,17 @@
{% 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 name, details in bevs.items() %} {% for bev in bevs %}
<h2>{{ name }}</h2> {% for name, details in bev.items() %}
<ul> <h2>{{ name }}</h2>
{% for name, amount in details['ingredients'].items() %} <ul>
<li>{% block amount scoped %}{% endblock %}{{ name }}</li> {% for ingredient in details['ingredients'] %}
{% endfor %} {% for name, amount in ingredient.items() %}
</ul> <li>{% block amount scoped %}{% endblock %}{{ name }}</li>
{% block directions scoped %}{% endblock %} {% endfor %}
{% endfor %}
</ul>
{% block directions scoped %}{% endblock %}
{% endfor %}
{% endfor %} {% endfor %}
{% endblock %} {% endblock %}