forked from dozens/protoadandsuperbowl
87 lines
2.3 KiB
Plaintext
87 lines
2.3 KiB
Plaintext
# 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
|
|
|
|
# new script
|
|
new:
|
|
#!/usr/bin/env sh
|
|
count=$(recsel -c db/database.rec)
|
|
read -p "first line: " top
|
|
read -p "second line: " bottom
|
|
printf -v id "%05d" $((++count))
|
|
recins --verbose -t comic \
|
|
-f "top" -v "$top" \
|
|
-f "bottom" -v "$bottom" \
|
|
-f "id" -v "$id" \
|
|
-f "date" -v "$(date -I)" \
|
|
db/database.rec
|
|
|
|
# update recfeed
|
|
recfeed:
|
|
recset db/feed.rec -t item -e 'id = 0' -f published -s `gdate -Iseconds`
|
|
recset db/feed.rec -t feed -n 0 -f updated -s `gdate -Iseconds`
|