Brew: Amundsen hazyday hero (#6)

* New brew: amundsen hazyday hero

* Helper script for adding new brews
This commit is contained in:
2023-06-24 21:02:52 +02:00
committed by GitHub
parent 94c27b0a8d
commit 5575d01e63
6 changed files with 150 additions and 107 deletions

24
add_brew.sh Normal file
View File

@@ -0,0 +1,24 @@
#!/bin/bash
brewFile=src/brews.json
date=$(date +%s)
# Ask the user for login details
read -p 'Name: ' name
read -p 'Brewery: ' brewery
read -p 'Category: ' category
read -p 'By: ' by
read -p 'Abv: ' abv
read -p 'Description: ' description
read -p 'Image filename: ' image
read -p 'Recipe url: ' recipe
read -p 'Order page url: ' orderPage
read -p 'Untapped url: ' untapped
read -p 'Primary color: ' colorPrimary
brew="{\"beer\":{\"name\":\"$name\",\"brewery\":\"$brewery\",\"category\":\"$category\"},\"date\":\"$date\",\"by\":\"$by\",\"abv\":\"$abv\",\"description\":\"$description\",\"image\":\"$image\",\"recipe\":\"$recipe\",\"order_page\":\"$orderPage\",\"untapped\":\"$untapped\",\"color_primary\":\"$colorPrimary\",\"secondary_color\":\"$colorSecondary\"}"
echo $(cat $brewFile | jq ".brews |= [$brew] + .") > $brewFile
echo "Brew $name added to $brewFile successfully!"

View File

@@ -1,4 +1,22 @@
[
{
"brews": [
{
"beer": {
"name": "Hazyday Hero",
"brewery": "Amundsen",
"category": "Hazy Session IPA"
},
"date": "1687631876",
"by": ["Andreas", "Ingvild", "Kevin"],
"abv": "4.2",
"description": "Bright aromas of orange peel and assorted citrus dominate, with floral undertones. Light bodied, but round and smooth. Flavours of orange and grapefruit juice backed by sweet sherbet. A soft palate makes for an easy drinking session IPA.",
"image": "amundsen_hazyday-hero.jpg",
"recipe": "https://www.dropbox.com/s/a5xl975lhflvspn/Hazyday%20Hero%2025ltr.pdf?dl=0",
"order_page": "https://www.hopstore.no/products/amundsen-everyday-hero-25l-olsett",
"untapped": "https://untappd.com/b/amundsen-brewery-hazyday-hero/4780922",
"color_primary": "#7AC49F",
"secondary_color": "rgba(122, 196, 159, 0.2)"
},
{
"beer": {
"name": "Kveldsbris",
@@ -107,4 +125,5 @@
"color_primary": "#6C8D9E",
"color_secondary": "rgba(108, 141, 158, 0.2)"
}
]
]
}

View File

@@ -9,7 +9,7 @@
let loadedTime: number = new Date().getTime();
let currentTime: number = new Date().getTime();
let autoReload = false;
const currentGoal = 4;
const currentGoal = 18.5;
function updateTime() {
currentTime = new Date().getTime();

View File

@@ -2,5 +2,5 @@ import brews from '../../brews.json';
import type { PageServerLoad } from './$types';
export const load: PageServerLoad = async () => {
return { brews };
return { brews: brews.brews };
};

View File

@@ -21,7 +21,7 @@ async function fetchGraphData(brew) {
export const load = (async ({ params }) => {
const { date } = params;
const brew = brews.find((b) => b?.date === date);
const brew = brews.brews.find((b) => b?.date === date);
if (!brew) {
throw error(404, 'Brew not found');

Binary file not shown.

After

Width:  |  Height:  |  Size: 572 KiB