big change. ripped out retroforth because it was kind of slow. put the whole thing in a recfile. surprising nobody. the difficult thing about this change (although i am otherwise happy) is that the source is a single file, the rec database at `/db/database.rec`. this makes it impossible (as far as i know) to to an incremental build such as with make(1) because the source file, as soon as you update it, is immediately newer than all of the target files. so everything gets rebuilt on every build. so i just build everything anyway for now. until i can figure out something better. also i export the comic to gemini, which you can find at the link below. gemini://tilde.town/~dozens/comic
68 lines
1.8 KiB
Makefile
68 lines
1.8 KiB
Makefile
# list available commands and exit
|
|
default:
|
|
@just --list --unsorted
|
|
|
|
# build rss feed
|
|
rss:
|
|
#!/bin/sh
|
|
exec > feed.xml
|
|
echo "<rss version=\"2.0\" xmlns:atom=\"http://www.w3.org/2005/Atom\">"
|
|
echo " <channel>"
|
|
echo " <title>It's Pro Toad and Superb Owl</title>"
|
|
echo " <link>https://git.tilde.town/dozens/protoadandsuperbowl</link>"
|
|
echo " <description>It's Pro Toad and Superb Owl!</description>"
|
|
echo " <atom:link rel=\"self\" type=\"application/rss+xml\" href=\"https://git.tilde.town/dozens/protoadandsuperbowl/raw/branch/master/feed.xml\"/>"
|
|
echo " <generator>/bin/sh</generator>"
|
|
recsel db/database.rec | recfmt -f templates/feed.tmpl
|
|
echo "</channel></rss>"
|
|
|
|
# watch toad.md for changes
|
|
watch:
|
|
echo "TODO"
|
|
alias dev := watch
|
|
|
|
# build markdown comics
|
|
markdown:
|
|
#!/bin/sh
|
|
for ((i = 0; i < $(recsel -c db/database.rec); i++))
|
|
do
|
|
id=$(recsel -P id -n $i db/database.rec)
|
|
recsel -n $i db/database.rec | recfmt -f templates/page.tmpl | fold -s -w 40 > $id.md
|
|
done
|
|
|
|
# build gemini
|
|
gemini:
|
|
#!/bin/sh
|
|
for ((i = 0; i < $(recsel -c db/database.rec); i++))
|
|
do
|
|
id=$(recsel -P id -n $i db/database.rec)
|
|
exec > gemini/$id.gmi
|
|
echo "# $id"
|
|
echo
|
|
recsel -n $i db/database.rec | recfmt -f templates/page.tmpl | fold -s -w 40
|
|
echo
|
|
echo "=> gemini://tilde.town/~dozens/comic"
|
|
done
|
|
|
|
# build gemini index
|
|
index:
|
|
#!/bin/sh
|
|
exec > gemini/index.gmi
|
|
echo "# Pro Toad and Superb Owl"
|
|
echo
|
|
echo "Two best friends have adventures!"
|
|
echo
|
|
recsel db/database.rec \
|
|
| recfmt "=> {{{{id}}.gmi {{{{date}} - {{{{id}}---" \
|
|
| sed 's/---/\n/g' \
|
|
| tail -r
|
|
echo
|
|
echo "=> gemini://tilde.town/~dozens/comic"
|
|
|
|
# go gemini
|
|
upload:
|
|
rsync -vurp gemini/* $HOME/blogs/gemini/comic
|
|
|
|
# build and rss
|
|
all: markdown gemini index upload rss
|