2021-08-29 20:59:57 +00:00
|
|
|
# list available commands and exit
|
|
|
|
default:
|
|
|
|
@just --list --unsorted
|
|
|
|
|
|
|
|
# build rss feed
|
|
|
|
rss:
|
2024-01-08 00:08:40 +00:00
|
|
|
#!/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>"
|
2021-08-29 20:59:57 +00:00
|
|
|
|
|
|
|
# watch toad.md for changes
|
|
|
|
watch:
|
2024-01-08 00:08:40 +00:00
|
|
|
echo "TODO"
|
2021-08-29 20:59:57 +00:00
|
|
|
alias dev := watch
|
|
|
|
|
2024-01-08 00:08:40 +00:00
|
|
|
# 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
|
2021-08-29 20:59:57 +00:00
|
|
|
done
|
2023-08-24 03:34:52 +00:00
|
|
|
|
2024-01-08 00:08:40 +00:00
|
|
|
# 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
|
|
|
|
|
2023-08-24 03:34:52 +00:00
|
|
|
# build and rss
|
2024-01-08 00:08:40 +00:00
|
|
|
all: markdown gemini index upload rss
|