diff options
author | Sylvain Gauthier <s94.gauthier@laposte.net> | 2021-03-12 08:46:07 +1100 |
---|---|---|
committer | Sylvain Gauthier <s94.gauthier@laposte.net> | 2021-03-15 10:34:59 +1100 |
commit | 9e997452760399c4cc8cee7a1d39952f8112995c (patch) | |
tree | 768dd53fe6501d2bd0b6e8b619fa56f8b76d4ab8 | |
parent | feb5d6ca8e96c579751788b676b14e72d51f84df (diff) | |
download | based.cooking-9e997452760399c4cc8cee7a1d39952f8112995c.tar based.cooking-9e997452760399c4cc8cee7a1d39952f8112995c.tar.gz based.cooking-9e997452760399c4cc8cee7a1d39952f8112995c.tar.lz based.cooking-9e997452760399c4cc8cee7a1d39952f8112995c.tar.xz based.cooking-9e997452760399c4cc8cee7a1d39952f8112995c.zip |
use a clean Makefile system to build/deploy site
This way, we get dependency/smart update for free. We don't need to
rebuild all the pages everytime a new one is added. The author, date of
creation and date of revision are extracted from git information. The
index is generated automatically, so adding a recipe is literally just
adding a markdown file in src/.
The deployment system uses rsync to push only newer data to the server.
There is a tag system that you can add at the end of each recipe file.
Tag pages are generated statically that contain all recipes with a given
tag.
It introduces more HTML template files, though.
To build website, type
make build
To deploy it,
make deploy
To clean everything,
make clean
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | Makefile | 180 | ||||
-rw-r--r-- | config | 5 | ||||
-rw-r--r-- | data/pix/beef-goulash.webp (renamed from src/pix/beef-goulash.webp) | bin | 162266 -> 162266 bytes | |||
-rw-r--r-- | data/pix/cacio-e-pepe.webp (renamed from src/pix/cacio-e-pepe.webp) | bin | 65704 -> 65704 bytes | |||
-rw-r--r-- | data/pix/carbonara.webp (renamed from src/pix/carbonara.webp) | bin | 265666 -> 265666 bytes | |||
-rw-r--r-- | data/pix/cheesy-meatballs.webp (renamed from src/pix/cheesy-meatballs.webp) | bin | 80978 -> 80978 bytes | |||
-rw-r--r-- | data/pix/country-skillet.webp (renamed from src/pix/country-skillet.webp) | bin | 120304 -> 120304 bytes | |||
-rw-r--r-- | data/pix/creamy-mashed-potatoes.webp (renamed from src/pix/creamy-mashed-potatoes.webp) | bin | 48440 -> 48440 bytes | |||
-rw-r--r-- | data/pix/croutons.webp (renamed from src/pix/croutons.webp) | bin | 93514 -> 93514 bytes | |||
-rw-r--r-- | data/pix/csalad.webp (renamed from src/pix/csalad.webp) | bin | 136552 -> 136552 bytes | |||
-rw-r--r-- | data/pix/fried-anglerfish-fillet-00.webp (renamed from src/pix/fried-anglerfish-fillet-00.webp) | bin | 67782 -> 67782 bytes | |||
-rw-r--r-- | data/pix/fried-anglerfish-fillet-01.webp (renamed from src/pix/fried-anglerfish-fillet-01.webp) | bin | 105868 -> 105868 bytes | |||
-rw-r--r-- | data/pix/guacamole.webp (renamed from src/pix/guacamole.webp) | bin | 145290 -> 145290 bytes | |||
-rw-r--r-- | data/pix/japanese-noodle-soup.webp (renamed from src/pix/japanese-noodle-soup.webp) | bin | 13220 -> 13220 bytes | |||
-rw-r--r-- | data/pix/merchants-buckwheat.webp (renamed from src/pix/merchants-buckwheat.webp) | bin | 135572 -> 135572 bytes | |||
-rw-r--r-- | data/pix/pan-seared-chicken.webp (renamed from src/pix/pan-seared-chicken.webp) | bin | 130012 -> 130012 bytes | |||
-rw-r--r-- | data/pix/parmesan-potatoes.webp (renamed from src/pix/parmesan-potatoes.webp) | bin | 94062 -> 94062 bytes | |||
-rw-r--r-- | data/pix/pasta-navy-style.webp (renamed from src/pix/pasta-navy-style.webp) | bin | 224476 -> 224476 bytes | |||
-rw-r--r-- | data/pix/refried-beans.webp (renamed from src/pix/refried-beans.webp) | bin | 63552 -> 63552 bytes | |||
-rw-r--r-- | data/pix/sunday-milkshake.webp (renamed from src/pix/sunday-milkshake.webp) | bin | 57248 -> 57248 bytes | |||
-rw-r--r-- | data/pix/sweet-potato-fries.webp (renamed from src/pix/sweet-potato-fries.webp) | bin | 51786 -> 51786 bytes | |||
-rw-r--r-- | data/pix/tuscan-style-pork-roast.webp (renamed from src/pix/tuscan-style-pork-roast.webp) | bin | 208664 -> 208664 bytes | |||
-rw-r--r-- | data/style.css (renamed from src/style.css) | 0 | ||||
-rw-r--r-- | example.md | 36 | ||||
-rw-r--r-- | index.md (renamed from src/index.md) | 0 | ||||
-rw-r--r-- | src/.ssgignore | 1 | ||||
-rw-r--r-- | src/_footer.html | 8 | ||||
-rw-r--r-- | src/_header.html | 12 | ||||
-rw-r--r-- | src/mortar-and-pestle.md | 17 | ||||
-rw-r--r-- | src/pix/bitcoin-based-cooking.webp | bin | 558 -> 0 bytes | |||
-rw-r--r-- | src/pix/mortar-and-pestle.webp | bin | 54694 -> 0 bytes | |||
-rw-r--r-- | src/salt.md | 41 | ||||
-rw-r--r-- | src/slow-cooking-tips.md | 17 | ||||
-rw-r--r-- | src/template.md | 49 | ||||
-rwxr-xr-x | ssg5 | 263 | ||||
-rw-r--r-- | templates/article_entry.html | 1 | ||||
-rw-r--r-- | templates/article_footer.html | 0 | ||||
-rw-r--r-- | templates/article_header.html | 2 | ||||
-rw-r--r-- | templates/article_list_footer.html | 1 | ||||
-rw-r--r-- | templates/article_list_header.html | 2 | ||||
-rw-r--r-- | templates/article_separator.html | 0 | ||||
-rw-r--r-- | templates/footer.html | 7 | ||||
-rw-r--r-- | templates/header.html | 12 | ||||
-rw-r--r-- | templates/index_footer.html | 0 | ||||
-rw-r--r-- | templates/index_header.html | 1 | ||||
-rw-r--r-- | templates/tag_entry.html | 1 | ||||
-rw-r--r-- | templates/tag_index_footer.html | 0 | ||||
-rw-r--r-- | templates/tag_index_header.html | 2 | ||||
-rw-r--r-- | templates/tag_list_footer.html | 1 | ||||
-rw-r--r-- | templates/tag_list_header.html | 1 | ||||
-rw-r--r-- | templates/tag_separator.html | 1 |
52 files changed, 219 insertions, 445 deletions
diff --git a/.gitignore b/.gitignore index 89ea64360..1df25ee9d 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -dest +rss.xml +atom.xml diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..8aa41a3ea --- /dev/null +++ b/Makefile @@ -0,0 +1,180 @@ +#!/usr/bin/make -f + +BLOG := $(MAKE) -f $(lastword $(MAKEFILE_LIST)) --no-print-directory +ifneq ($(filter-out help,$(MAKECMDGOALS)),) +include config +endif + +# The following can be configured in config +BLOG_DATE_FORMAT_INDEX ?= %x +BLOG_DATE_FORMAT ?= %x %X +BLOG_TITLE ?= blog +BLOG_DESCRIPTION ?= blog +BLOG_URL_ROOT ?= http://localhost/blog +BLOG_FEED_MAX ?= 20 +BLOG_FEEDS ?= rss atom +BLOG_SRC ?= articles + + +.PHONY: help init build deploy clean + +ARTICLES = $(shell git ls-tree HEAD --name-only -- $(BLOG_SRC)/ 2>/dev/null) +TAGFILES = $(patsubst $(BLOG_SRC)/%.md,tags/%,$(ARTICLES)) + +help: + $(info blogit init|build|deploy|clean) + +init: + mkdir -p $(BLOG_SRC) data templates + printf '<!DOCTYPE html><html><head><title>$$TITLE</title></head><body>' > templates/header.html + printf '</body></html>' > templates/footer.html + printf '' > templates/index_header.html + printf '<p>Tags:' > templates/tag_list_header.html + printf '<a href="$$URL">$$NAME</a>' > templates/tag_entry.html + printf ', ' > templates/tag_separator.html + printf '</p>' > templates/tag_list_footer.html + printf '<h2>Articles</h2><ul>' > templates/article_list_header.html + printf '<li><a href="$$URL">$$DATE $$TITLE</a></li>' > templates/article_entry.html + printf '' > templates/article_separator.html + printf '</ul>' > templates/article_list_footer.html + printf '' > templates/index_footer.html + printf '' > templates/tag_index_header.html + printf '' > templates/tag_index_footer.html + printf '' > templates/article_header.html + printf '' > templates/article_footer.html + printf 'blog\n' > .git/info/exclude + +build: blog/index.html tagpages $(patsubst $(BLOG_SRC)/%.md,blog/%.html,$(ARTICLES)) $(patsubst %,blog/%.xml,$(BLOG_FEEDS)) + +deploy: build + rsync -rLtvz $(BLOG_RSYNC_OPTS) blog/ data/ $(BLOG_REMOTE) + +clean: + rm -rf blog tags + +config: + printf 'BLOG_REMOTE:=%s\n' \ + '$(shell printf "Blog remote (eg: host:/var/www/html): ">/dev/tty; head -n1)' \ + > $@ + +tags/%: $(BLOG_SRC)/%.md + mkdir -p tags + grep -i '^; *tags:' "$<" | cut -d: -f2- | sed 's/ */\n/g' | sed '/^$$/d' | sort -u > $@ + +blog/index.html: $(ARTICLES) $(TAGFILES) $(addprefix templates/,$(addsuffix .html,header index_header tag_list_header tag_entry tag_separator tag_list_footer article_list_header article_entry article_separator article_list_footer index_footer footer)) + mkdir -p blog + TITLE="$(BLOG_TITLE)"; \ + export TITLE; \ + envsubst < templates/header.html > $@; \ + envsubst < templates/index_header.html >> $@; \ + envsubst < templates/tag_list_header.html >> $@; \ + first=true; \ + for t in $(shell cat $(TAGFILES) | sort -u); do \ + "$$first" || envsubst < templates/tag_separator.html; \ + NAME="$$t" \ + URL="@$$t.html" \ + envsubst < templates/tag_entry.html; \ + first=false; \ + done >> $@; \ + envsubst < templates/tag_list_footer.html >> $@; \ + envsubst < templates/article_list_header.html >> $@; \ + first=true; \ + for f in $(ARTICLES); do \ + printf '%s ' "$$f"; \ + git log --diff-filter=A --date="format:%s $(BLOG_DATE_FORMAT_INDEX)" --pretty=format:'%ad%n' -- "$$f"; \ + done | sort -k2nr | cut -d" " -f1,3- | while IFS=" " read -r FILE DATE; do \ + "$$first" || envsubst < templates/article_separator.html; \ + URL="`printf '%s' "\$$FILE" | sed 's,^$(BLOG_SRC)/\(.*\).md,\1,'`.html" \ + DATE="$$DATE" \ + TITLE="`head -n1 "\$$FILE" | sed -e 's/^# //g'`" \ + envsubst < templates/article_entry.html; \ + first=false; \ + done >> $@; \ + envsubst < templates/article_list_footer.html >> $@; \ + envsubst < templates/index_footer.html >> $@; \ + envsubst < templates/footer.html >> $@; \ + + +blog/tag/%.html: $(ARTICLES) $(addprefix templates/,$(addsuffix .html,header tag_header index_entry tag_footer footer)) + +.PHONY: tagpages +tagpages: $(TAGFILES) + +$(BLOG) $(patsubst %,blog/@%.html,$(shell cat $(TAGFILES) | sort -u)) + +blog/@%.html: $(TAGFILES) $(addprefix templates/,$(addsuffix .html,header tag_index_header tag_list_header tag_entry tag_separator tag_list_footer article_list_header article_entry article_separator article_list_footer tag_index_footer footer)) + mkdir -p blog + TITLE="Articles tagged $*"; \ + TAGS="$*"; \ + export TITLE; \ + export TAGS; \ + envsubst < templates/header.html > $@; \ + envsubst < templates/tag_index_header.html >> $@; \ + envsubst < templates/article_list_header.html >> $@; \ + first=true; \ + for f in $(shell grep -FH '$*' $(TAGFILES) | sed 's,^tags/\([^:]*\):.*,$(BLOG_SRC)/\1.md,'); do \ + printf '%s ' "$$f"; \ + git log --diff-filter=A --date="format:%s $(BLOG_DATE_FORMAT_INDEX)" --pretty=format:'%ad%n' -- "$$f"; \ + done | sort -k2nr | cut -d" " -f1,3- | while IFS=" " read -r FILE DATE; do \ + "$$first" || envsubst < templates/article_separator.html; \ + URL="`printf '%s' "\$$FILE" | sed 's,^$(BLOG_SRC)/\(.*\).md,\1,'`.html" \ + DATE="$$DATE" \ + TITLE="`head -n1 "\$$FILE" | sed -e 's/^# //g'`" \ + envsubst < templates/article_entry.html; \ + first=false; \ + done >> $@; \ + envsubst < templates/article_list_footer.html >> $@; \ + envsubst < templates/tag_index_footer.html >> $@; \ + envsubst < templates/footer.html >> $@; \ + + +blog/%.html: $(BLOG_SRC)/%.md $(addprefix templates/,$(addsuffix .html,header article_header article_footer footer)) + mkdir -p blog + TITLE="$(shell head -n1 $<)"; \ + export TITLE; \ + AUTHOR="$(shell git log --format="%an" -- "$<" | tail -n 1)"; \ + export AUTHOR; \ + DATE_POSTED="$(shell git log --diff-filter=A --date="format:$(BLOG_DATE_FORMAT)" --pretty=format:'%ad' -- "$<")"; \ + export DATE_POSTED; \ + DATE_EDITED="$(shell git log -n 1 --date="format:$(BLOG_DATE_FORMAT)" --pretty=format:'%ad' -- "$<")"; \ + export DATE_EDITED; \ + TAGS="$(shell grep -i '^; *tags:' "$<" | cut -d: -f2- | paste -sd ',')"; \ + export TAGS; \ + envsubst < templates/header.html > $@; \ + envsubst < templates/article_header.html >> $@; \ + sed -e '/^;/d' < $< | markdown -f fencedcode >> $@; \ + envsubst < templates/article_footer.html >> $@; \ + envsubst < templates/footer.html >> $@; \ + +blog/rss.xml: $(ARTICLES) + printf '<?xml version="1.0" encoding="UTF-8"?>\n<rss version="2.0">\n<channel>\n<title>%s</title>\n<link>%s</link>\n<description>%s</description>\n' \ + "$(BLOG_TITLE)" "$(BLOG_URL_ROOT)" "$(BLOG_DESCRIPTION)" > $@ + for f in $(ARTICLES); do \ + printf '%s ' "$$f"; \ + git log --diff-filter=A --date="format:%s %a, %d %b %Y %H:%M:%S %z" --pretty=format:'%ad%n' -- "$$f"; \ + done | sort -k2nr | head -n $(BLOG_FEED_MAX) | cut -d" " -f1,3- | while IFS=" " read -r FILE DATE; do \ + printf '<item>\n<title>%s</title>\n<link>%s</link>\n<guid>%s</guid>\n<pubDate>%s</pubDate>\n<description>%s</description>\n</item>\n' \ + "`head -n 1 $$FILE`" \ + "$(BLOG_URL_ROOT)/`basename $$FILE`.html" \ + "$(BLOG_URL_ROOT)/`basename $$FILE`.html" \ + "$$DATE" \ + "`sed -n '1d;/^$$/{2{d;b};q};p' < $$FILE`"; \ + done >> $@ + printf '</channel>\n</rss>\n' >> $@ + +blog/atom.xml: $(ARTICLES) + printf '<?xml version="1.0" encoding="UTF-8"?>\n<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">\n<title type="text">%s</title>\n<subtitle type="text">%s</subtitle>\n<updated>%s</updated>\n<link rel="alternate" type="text/html" href="%s"/>\n<id>%s</id>\n<link rel="self" type="application/atom+xml" href="%s"/>\n' \ + "$(BLOG_TITLE)" "$(BLOG_DESCRIPTION)" "$(shell date +%Y-%m-%dT%H:%M:%SZ)" "$(BLOG_URL_ROOT)" "$(BLOG_URL_ROOT)/atom.xml" "$(BLOG_URL_ROOT)/atom.xml" > $@ + for f in $(ARTICLES); do \ + printf '%s ' "$$f"; \ + git log --diff-filter=A --date="format:%s %Y-%m-%dT%H:%M:%SZ" --pretty=format:'%ad %aN%n' -- "$$f"; \ + done | sort -k2nr | head -n $(BLOG_FEED_MAX) | cut -d" " -f1,3- | while IFS=" " read -r FILE DATE AUTHOR; do \ + printf '<entry>\n<title type="text">%s</title>\n<link rel="alternate" type="text/html" href="%s"/>\n<id>%s</id>\n<published>%s</published>\n<updated>%s</updated>\n<author><name>%s</name></author>\n<summary type="text">%s</summary>\n</entry>\n' \ + "`head -n 1 $$FILE`" \ + "$(BLOG_URL_ROOT)/`basename $$FILE`.html" \ + "$(BLOG_URL_ROOT)/`basename $$FILE`.html" \ + "$$DATE" \ + "`git log -n 1 --date="format:%Y-%m-%dT%H:%M:%SZ" --pretty=format:'%ad' -- "$$FILE"`" \ + "$$AUTHOR" \ + "`sed -n '1d;/^$$/{2{d;b};q};p' < $$FILE`"; \ + done >> $@ + printf '</feed>\n' >> $@ @@ -0,0 +1,5 @@ +BLOG_TITLE:=based.cooking +BLOG_REMOTE:= +BLOG_DATE_FORMAT_INDEX:=%F +BLOG_DATE_FORMAT:=%F %H:%M +BLOG_SRC:=src diff --git a/src/pix/beef-goulash.webp b/data/pix/beef-goulash.webp Binary files differindex 1f9b1ff0b..1f9b1ff0b 100644 --- a/src/pix/beef-goulash.webp +++ b/data/pix/beef-goulash.webp diff --git a/src/pix/cacio-e-pepe.webp b/data/pix/cacio-e-pepe.webp Binary files differindex 6921d9f52..6921d9f52 100644 --- a/src/pix/cacio-e-pepe.webp +++ b/data/pix/cacio-e-pepe.webp diff --git a/src/pix/carbonara.webp b/data/pix/carbonara.webp Binary files differindex da6c54980..da6c54980 100644 --- a/src/pix/carbonara.webp +++ b/data/pix/carbonara.webp diff --git a/src/pix/cheesy-meatballs.webp b/data/pix/cheesy-meatballs.webp Binary files differindex 2bb0b4f39..2bb0b4f39 100644 --- a/src/pix/cheesy-meatballs.webp +++ b/data/pix/cheesy-meatballs.webp diff --git a/src/pix/country-skillet.webp b/data/pix/country-skillet.webp Binary files differindex a0ad2c315..a0ad2c315 100644 --- a/src/pix/country-skillet.webp +++ b/data/pix/country-skillet.webp diff --git a/src/pix/creamy-mashed-potatoes.webp b/data/pix/creamy-mashed-potatoes.webp Binary files differindex d496bc3a7..d496bc3a7 100644 --- a/src/pix/creamy-mashed-potatoes.webp +++ b/data/pix/creamy-mashed-potatoes.webp diff --git a/src/pix/croutons.webp b/data/pix/croutons.webp Binary files differindex e77932845..e77932845 100644 --- a/src/pix/croutons.webp +++ b/data/pix/croutons.webp diff --git a/src/pix/csalad.webp b/data/pix/csalad.webp Binary files differindex bf37a2fe6..bf37a2fe6 100644 --- a/src/pix/csalad.webp +++ b/data/pix/csalad.webp diff --git a/src/pix/fried-anglerfish-fillet-00.webp b/data/pix/fried-anglerfish-fillet-00.webp Binary files differindex 6b85d02ac..6b85d02ac 100644 --- a/src/pix/fried-anglerfish-fillet-00.webp +++ b/data/pix/fried-anglerfish-fillet-00.webp diff --git a/src/pix/fried-anglerfish-fillet-01.webp b/data/pix/fried-anglerfish-fillet-01.webp Binary files differindex a95ebab0c..a95ebab0c 100644 --- a/src/pix/fried-anglerfish-fillet-01.webp +++ b/data/pix/fried-anglerfish-fillet-01.webp diff --git a/src/pix/guacamole.webp b/data/pix/guacamole.webp Binary files differindex 690cd7c59..690cd7c59 100644 --- a/src/pix/guacamole.webp +++ b/data/pix/guacamole.webp diff --git a/src/pix/japanese-noodle-soup.webp b/data/pix/japanese-noodle-soup.webp Binary files differindex 85ca3267f..85ca3267f 100644 --- a/src/pix/japanese-noodle-soup.webp +++ b/data/pix/japanese-noodle-soup.webp diff --git a/src/pix/merchants-buckwheat.webp b/data/pix/merchants-buckwheat.webp Binary files differindex d294c476a..d294c476a 100644 --- a/src/pix/merchants-buckwheat.webp +++ b/data/pix/merchants-buckwheat.webp diff --git a/src/pix/pan-seared-chicken.webp b/data/pix/pan-seared-chicken.webp Binary files differindex e030e100d..e030e100d 100644 --- a/src/pix/pan-seared-chicken.webp +++ b/data/pix/pan-seared-chicken.webp diff --git a/src/pix/parmesan-potatoes.webp b/data/pix/parmesan-potatoes.webp Binary files differindex 42c81cd16..42c81cd16 100644 --- a/src/pix/parmesan-potatoes.webp +++ b/data/pix/parmesan-potatoes.webp diff --git a/src/pix/pasta-navy-style.webp b/data/pix/pasta-navy-style.webp Binary files differindex 2836d66f5..2836d66f5 100644 --- a/src/pix/pasta-navy-style.webp +++ b/data/pix/pasta-navy-style.webp diff --git a/src/pix/refried-beans.webp b/data/pix/refried-beans.webp Binary files differindex 9f49af62c..9f49af62c 100644 --- a/src/pix/refried-beans.webp +++ b/data/pix/refried-beans.webp diff --git a/src/pix/sunday-milkshake.webp b/data/pix/sunday-milkshake.webp Binary files differindex bdb90743e..bdb90743e 100644 --- a/src/pix/sunday-milkshake.webp +++ b/data/pix/sunday-milkshake.webp diff --git a/src/pix/sweet-potato-fries.webp b/data/pix/sweet-potato-fries.webp Binary files differindex 62bec8ab7..62bec8ab7 100644 --- a/src/pix/sweet-potato-fries.webp +++ b/data/pix/sweet-potato-fries.webp diff --git a/src/pix/tuscan-style-pork-roast.webp b/data/pix/tuscan-style-pork-roast.webp Binary files differindex eaaea0f39..eaaea0f39 100644 --- a/src/pix/tuscan-style-pork-roast.webp +++ b/data/pix/tuscan-style-pork-roast.webp diff --git a/src/style.css b/data/style.css index 2e6aa32ae..2e6aa32ae 100644 --- a/src/style.css +++ b/data/style.css diff --git a/example.md b/example.md deleted file mode 100644 index dfb3d052b..000000000 --- a/example.md +++ /dev/null @@ -1,36 +0,0 @@ -# This is the dish title - -If necessary, provide a very brief description of the dish in one or two sentences. -For most dishes, this will be unnecessary. -If there is a title image of this dish, it should be above this paragraph. -You may also include prep/cook time and the number of servings as below: - -- ⏲️ Prep time: 10 min -- 🍳Cook time: 30 min -- 🍽️ Servings: 4 - -## Ingredients - -- List the ingredients -- in an unordered list -- similar to this. -- List amounts if necessary. -- Put (optional) at the end of optional ingredients - -## Directions - -1. Now using an ordered list, -2. give the directions to prepare the dish. -3. Do **not** add unnecessary blank lines between items. -4. If necessary, -5. an image can be included between some directions if needed to explain something particular. -6. But that should be kept to a minimum to reduce bandwidth and aid in simplicity. - -## Contribution - -Here, just put your name and links to yourself (maybe a website or donation link) if you want. -You may say "Anonymous" or a screenname if desired. -If you add something substantial to an already existing recipe (including and image) you may add your name below with the contribution in parens. - -- Luke Smith - [website](https://lukesmith.xyz), [donate](https://lukesmith.xyz/donate) -- Luke Smith (photo credit) - [website](https://lukesmith.xyz), [donate](https://lukesmith.xyz/donate) diff --git a/src/index.md b/index.md index 22aaf607e..22aaf607e 100644 --- a/src/index.md +++ b/index.md diff --git a/src/.ssgignore b/src/.ssgignore deleted file mode 100644 index febf952fa..000000000 --- a/src/.ssgignore +++ /dev/null @@ -1 +0,0 @@ -template.md diff --git a/src/_footer.html b/src/_footer.html deleted file mode 100644 index 452246e27..000000000 --- a/src/_footer.html +++ /dev/null @@ -1,8 +0,0 @@ - - <footer> - <a href="index.html">🏡 Based Cooking Homepage</a> </br> - All site content is in the Public Domain. - </footer> - - </body> -</html> diff --git a/src/_header.html b/src/_header.html deleted file mode 100644 index 31106815a..000000000 --- a/src/_header.html +++ /dev/null @@ -1,12 +0,0 @@ -<!DOCTYPE html> -<html lang="en"> - - <head> - <title></title> - <meta charset=UTF-8> - <link rel=stylesheet href=style.css> - <link rel="shortcut icon" type="image/x-icon" href="favicon.png"> - <meta name="viewport" content="width=device-width, initial-scale=1"> - </head> - - <body> diff --git a/src/mortar-and-pestle.md b/src/mortar-and-pestle.md deleted file mode 100644 index 6abf38759..000000000 --- a/src/mortar-and-pestle.md +++ /dev/null @@ -1,17 +0,0 @@ -# Get a Mortar and Pestle - -![mortar-and-pestle](pix/mortar-and-pestle.webp) - -Mortars and pestles are tools which have unfortunately been nearly forgotten in modern American kitchens, but they -have been around since the stone age for a reason. -They are one of the most useful appliances and require no electricity. - -They easily smash garlic, nuts and other things (also automatically removes skins). -This is much better than simple slicing because it squeezes out the juices and tastes of things. - -You can also easily make paste (like pesto) and out of herbs and other simple ingredients. -Many people use a hard-to-clean and expensive electric food processor to do things like this, -but a larger mortar and pestle could get the job done just as easily. - -Do not get porcelain mortar and pestles; they are non-functional and loud. -I have two granite ones which work very well (see pic above). diff --git a/src/pix/bitcoin-based-cooking.webp b/src/pix/bitcoin-based-cooking.webp Binary files differdeleted file mode 100644 index 1c5c8afb3..000000000 --- a/src/pix/bitcoin-based-cooking.webp +++ /dev/null diff --git a/src/pix/mortar-and-pestle.webp b/src/pix/mortar-and-pestle.webp Binary files differdeleted file mode 100644 index dd9479578..000000000 --- a/src/pix/mortar-and-pestle.webp +++ /dev/null diff --git a/src/salt.md b/src/salt.md deleted file mode 100644 index e35af4fa9..000000000 --- a/src/salt.md +++ /dev/null @@ -1,41 +0,0 @@ -# Table Salt vs. Kosher Salt - -Table salt is the salt on your table: teeny-tiny grains in a little shaker. - -Kosher salt is the salt that should be in your kitchen: large, thick grains. - -Some people new to cooking get confused on the difference and when to use one or the other. - -The long story short is you should always use kosher salt for cooking. -Table salt is much more intense and is only for brisk post-cooking flavoring at the table. -Kosher salt is more subtle, dissolves slower and thus releases its flavor slower. - -Note also that you should add a larger mass of kosher salt where you might only -add a pinch of table salt, since table salt is much stronger partially because -it dissolves so quickly. - -## Table salt is not lindy. - -Table salt has iodine and other additives. - -Its history is somewhat analogous to the addition of fluoride to municipal -water supplies. Nearly a hundred years ago, the U.S. government began working -with corporations to add iodine to salt ostensibly because they were concerned -about people having iodine deficiencies. - -A healthy diet including eggs, dairy and some seafood should get enough iodine -elsewhere to not need it in the form of table salt supplements, so don't feel -like to you need to use it. - -## Why is kosher salt called "kosher" salt? - -Hebrews and then Jews revile eating meat with any blood in it. Larger grain -salt was better for the process called "koshering" whereby meat is covered in -salt and the salt draws out the liquid blood. Note that table salt is not -non-kosher in Mosaic law either, it is simply not suited for this "koshering" -process because it simply dissolves into the meat. - -For one reason or another, this association caught on and we now call coarse -grain salt "kosher." Note that kosher salt is more or less the natural form of -salt, it is not, as one might imagine, some new innovation to comply with -Jewish dietary practice. diff --git a/src/slow-cooking-tips.md b/src/slow-cooking-tips.md deleted file mode 100644 index e63544559..000000000 --- a/src/slow-cooking-tips.md +++ /dev/null @@ -1,17 +0,0 @@ -# Slow Cooking Benefits and Tips - -You can buy a Slow Cooker for cheap, but it is still one of the most precious tools you can have in a kitchen. - -## Benefits - -- It's cheap: slow-cooking turns the toughest and cheapest cuts of meat into that "fall off the bone" goodness. Chuck steak and pork shoulder/Boston butts are some of the cheapest meats and are sure hard to eat, but put them in a slow-cooker and it's gourmet stuff. -- It is easy and low-effort: ingredients take very little time to prep and the cooking happens overnight or while you're at work. -- It's an objective science: a lot of people have a hard time developing the best techniques for kneading or pan-frying or other culinary skills, but slow-cooking just requires you put the ingredients in. No magic, just follow directions. -- It's relaxing: by the time your food is done, you've had plenty of time to clean up, so you can serve and eat your meal without having to worry about cleaning up afterwards. -- It's portable: you can cook for an event or your friends because you load up your slow-cooker and go. - -## Tips - -- Things that need more cooking should always go at the bottom. For example, potatoes take forever to cook, so put them under your meat. They'll get the extra cooking they need while getting marinated in juices. -- Only slow-cook dry herbs, not freshly-picked herbs, although you can add freshly-picked herbs in the last 10 or 20 minutes for some extra flavor. -- Only take off the top to check how things are doing in absolute emergencies. It loses a lot more heat than you might expect when you open that. diff --git a/src/template.md b/src/template.md deleted file mode 100644 index eca38fdaf..000000000 --- a/src/template.md +++ /dev/null @@ -1,49 +0,0 @@ -# Recipe name - -This is a brief, one or two sentence description of the dish. - -Optionally include a picture of the dish here, stored in `pix/` with the same base name as this file. -Please take your own picture after having followed exactly this recipe. - -## Ingredients - -- Just do -- a very simple -- markdown list for this -- with amounts. - -## Directions - -1. Now include the directions. -2. I suppose this list should be numbered -3. just for convenience's sake. -4. If necessary, include directional images between these items. - -![like this](lol.webp) - -5. Looks good. -6. Obvious, - -## Contributors - -<!-- -Put your name or identifier here if you want. -Limit yourself to a single line with links like this: ---> - -- **Luke Smith** -- [website](https://lukesmith.xyz), [donate](https://lukesmith.xyz/donate) -- Billy Smith -- [website](https://lukesmith.xyz) (improved kneading technique added) - -<!-- -If someone add a *substantial* improvement, they can add their name to the -bottom of the list (at least for the time being). In that case, the original -author's line should still be at the top and bold. ---> - -<!-- -Other Rules: - -- Images should be as small as possible in size, preferably .webp files. -- Minor edits (spell checkings) do not warrant credit at the bottom. -- Everything you add here should be public domain. Getting credit at the bottom for adding the article is not a claim to ownership. ---> @@ -1,263 +0,0 @@ -#!/bin/sh -e -# -# https://rgz.ee/bin/ssg5 -# Copyright 2018-2019 Roman Zolotarev <hi@romanzolotarev.com> -# -# Permission to use, copy, modify, and/or distribute this software for any -# purpose with or without fee is hereby granted, provided that the above -# copyright notice and this permission notice appear in all copies. -# -# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -# - -main() { - test -n "$1" || usage - test -n "$2" || usage - test -n "$3" || usage - test -n "$4" || usage - test -d "$1" || no_dir "$1" - test -d "$2" || no_dir "$2" - - src=$(readlink_f "$1") - dst=$(readlink_f "$2") - - IGNORE=$( - if ! test -f "$src/.ssgignore" - then - printf ' ! -path "*/.*"' - return - fi - while read -r x - do - test -n "$x" || continue - printf ' ! -path "*/%s*"' "$x" - done < "$src/.ssgignore" - ) - - # files - - title="$3" - - h_file="$src/_header.html" - f_file="$src/_footer.html" - test -f "$f_file" && FOOTER=$(cat "$f_file") && export FOOTER - test -f "$h_file" && HEADER=$(cat "$h_file") && export HEADER - - list_dirs "$src" | - (cd "$src" && cpio -pdu "$dst") - - fs=$( - if test -f "$dst/.files" - then list_affected_files "$src" "$dst/.files" - else list_files "$1" - fi - ) - - if test -n "$fs" - then - echo "$fs" | tee "$dst/.files" - - if echo "$fs" | grep -q '\.md$' - then - if test -x "$(which lowdown 2> /dev/null)" - then - echo "$fs" | grep '\.md$' | - render_md_files_lowdown "$src" "$dst" "$title" - else - if test -x "$(which Markdown.pl 2> /dev/null)" - then - echo "$fs" | grep '\.md$' | - render_md_files_Markdown_pl "$src" "$dst" "$title" - else - echo "couldn't find lowdown nor Markdown.pl" - exit 3 - fi - fi - fi - - echo "$fs" | grep '\.html$' | - render_html_files "$src" "$dst" "$title" - - echo "$fs" | grep -Ev '\.md$|\.html$' | - (cd "$src" && cpio -pu "$dst") - fi - - printf '[ssg] ' >&2 - print_status 'file, ' 'files, ' "$fs" >&2 - - - # sitemap - - base_url="$4" - date=$(date +%Y-%m-%d) - urls=$(list_pages "$src") - - test -n "$urls" && - render_sitemap "$urls" "$base_url" "$date" > "$dst/sitemap.xml" - - print_status 'url' 'urls' "$urls" >&2 - echo >&2 -} - - -readlink_f() { - file="$1" - cd "$(dirname "$file")" - file=$(basename "$file") - while test -L "$file" - do - file=$(readlink "$file") - cd "$(dirname "$file")" - file=$(basename "$file") - done - dir=$(pwd -P) - echo "$dir/$file" -} - - -print_status() { - test -z "$3" && printf 'no %s' "$2" && return - - echo "$3" | awk -v singular="$1" -v plural="$2" ' - END { - if (NR==1) printf NR " " singular - if (NR>1) printf NR " " plural - }' -} - - -usage() { - echo "usage: ${0##*/} src dst title base_url" >&2 - exit 1 -} - - -no_dir() { - echo "${0##*/}: $1: No such directory" >&2 - exit 2 -} - -list_dirs() { - cd "$1" && eval "find . -type d ! -name '.' ! -path '*/_*' $IGNORE" -} - - -list_files() { - cd "$1" && eval "find . -type f ! -name '.' ! -path '*/_*' $IGNORE" -} - - -list_dependant_files () { - e="\\( -name '*.html' -o -name '*.md' -o -name '*.css' -o -name '*.js' \\)" - cd "$1" && eval "find . -type f ! -name '.' ! -path '*/_*' $IGNORE $e" -} - -list_newer_files() { - cd "$1" && eval "find . -type f ! -name '.' $IGNORE -newer $2" -} - - -has_partials() { - grep -qE '^./_.*\.html$|^./_.*\.js$|^./_.*\.css$' -} - - -list_affected_files() { - fs=$(list_newer_files "$1" "$2") - - if echo "$fs" | has_partials - then list_dependant_files "$1" - else echo "$fs" - fi -} - - -render_html_files() { - while read -r f - do render_html_file "$3" < "$1/$f" > "$2/$f" - done -} - - -render_md_files_lowdown() { - while read -r f - do - lowdown \ - < "$1/$f" | - render_html_file "$3" \ - > "$2/${f%\.md}.html" - done -} - - -render_md_files_Markdown_pl() { - while read -r f - do - Markdown.pl < "$1/$f" | - render_html_file "$3" \ - > "$2/${f%\.md}.html" - done -} - - -render_html_file() { - # h/t Devin Teske - awk -v title="$1" ' - { body = body "\n" $0 } - END { - body = substr(body, 2) - if (body ~ /<[Hh][Tt][Mm][Ll]/) { - print body - exit - } - if (match(body, /<[[:space:]]*[Hh]1(>|[[:space:]][^>]*>)/)) { - t = substr(body, RSTART + RLENGTH) - sub("<[[:space:]]*/[[:space:]]*[Hh]1.*", "", t) - gsub(/^[[:space:]]*|[[:space:]]$/, "", t) - if (t) title = t " — " title - } - n = split(ENVIRON["HEADER"], header, /\n/) - for (i = 1; i <= n; i++) { - if (match(tolower(header[i]), "<title></title>")) { - head = substr(header[i], 1, RSTART - 1) - tail = substr(header[i], RSTART + RLENGTH) - print head "<title>" title "</title>" tail - } else print header[i] - } - print body - print ENVIRON["FOOTER"] - }' -} - - -list_pages() { - e="\\( -name '*.html' -o -name '*.md' \\)" - cd "$1" && eval "find . -type f ! -path '*/.*' ! -path '*/_*' $IGNORE $e" | - sed 's#^./##;s#.md$#.html#;s#/index.html$#/#' -} - - -render_sitemap() { - urls="$1" - base_url="$2" - date="$3" - - echo '<?xml version="1.0" encoding="UTF-8"?>' - echo '<urlset' - echo 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"' - echo 'xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9' - echo 'http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"' - echo 'xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' - echo "$urls" | - sed -E 's#^(.*)$#<url><loc>'"$base_url"'/\1</loc><lastmod>'\ -"$date"'</lastmod><priority>1.0</priority></url>#' - echo '</urlset>' -} - -main "$@" diff --git a/templates/article_entry.html b/templates/article_entry.html new file mode 100644 index 000000000..4c149eb40 --- /dev/null +++ b/templates/article_entry.html @@ -0,0 +1 @@ +<li><a href="$URL">$TITLE</a></li> diff --git a/templates/article_footer.html b/templates/article_footer.html new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/templates/article_footer.html diff --git a/templates/article_header.html b/templates/article_header.html new file mode 100644 index 000000000..e66f98c99 --- /dev/null +++ b/templates/article_header.html @@ -0,0 +1,2 @@ +<p><a href=".">index</a></p> +<p><i>Recipe posted on: $DATE_POSTED, last edited on: $DATE_EDITED, written by: $AUTHOR</i></p> diff --git a/templates/article_list_footer.html b/templates/article_list_footer.html new file mode 100644 index 000000000..3d3a44c9e --- /dev/null +++ b/templates/article_list_footer.html @@ -0,0 +1 @@ +</ul> diff --git a/templates/article_list_header.html b/templates/article_list_header.html new file mode 100644 index 000000000..54ba16f74 --- /dev/null +++ b/templates/article_list_header.html @@ -0,0 +1,2 @@ +<h2>Recipes</h2> +<ul> diff --git a/templates/article_separator.html b/templates/article_separator.html new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/templates/article_separator.html diff --git a/templates/footer.html b/templates/footer.html new file mode 100644 index 000000000..b7cd6bfdb --- /dev/null +++ b/templates/footer.html @@ -0,0 +1,7 @@ +<p>This website is a fork from <a href="https://based.cooking">Luke Smith's Based Cooking</a></p> +<div class="footer"> + <hr/> + <a href="./rss.xml">RSS</a> + <a href="./atom.xml">atom</a> +</div> +</body></html> diff --git a/templates/header.html b/templates/header.html new file mode 100644 index 000000000..9b6f9f400 --- /dev/null +++ b/templates/header.html @@ -0,0 +1,12 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="UTF-8"> + <link rel="stylesheet" href="./style.css"> + <title>$TITLE</title> + </head> + <body> + <div class="banner"> + <h1>🍳 Based Cooking 🍲</h1> + <hr/> + </div> diff --git a/templates/index_footer.html b/templates/index_footer.html new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/templates/index_footer.html diff --git a/templates/index_header.html b/templates/index_header.html new file mode 100644 index 000000000..a222e9a6e --- /dev/null +++ b/templates/index_header.html @@ -0,0 +1 @@ +<p>Only Based cooking. No ads, no tracking, nothing but based cooking.</p> diff --git a/templates/tag_entry.html b/templates/tag_entry.html new file mode 100644 index 000000000..cb23fee0a --- /dev/null +++ b/templates/tag_entry.html @@ -0,0 +1 @@ +<a href="$URL">$NAME</a>
\ No newline at end of file diff --git a/templates/tag_index_footer.html b/templates/tag_index_footer.html new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/templates/tag_index_footer.html diff --git a/templates/tag_index_header.html b/templates/tag_index_header.html new file mode 100644 index 000000000..2d7315301 --- /dev/null +++ b/templates/tag_index_header.html @@ -0,0 +1,2 @@ +<p><a href=".">index</a></p> +<p><i>Filtering recipes tagged:</i> <b>$TAGS</b></p> diff --git a/templates/tag_list_footer.html b/templates/tag_list_footer.html new file mode 100644 index 000000000..38bf9e7de --- /dev/null +++ b/templates/tag_list_footer.html @@ -0,0 +1 @@ +</i></p> diff --git a/templates/tag_list_header.html b/templates/tag_list_header.html new file mode 100644 index 000000000..ae3a7595c --- /dev/null +++ b/templates/tag_list_header.html @@ -0,0 +1 @@ +<p><i>Tags: diff --git a/templates/tag_separator.html b/templates/tag_separator.html new file mode 100644 index 000000000..c3a6e485b --- /dev/null +++ b/templates/tag_separator.html @@ -0,0 +1 @@ +,
\ No newline at end of file |