gardener/justfile

42 lines
1.3 KiB
Plaintext

# vars
feed_title := "dozens weed"
feed_desc := "my special little weed in my special little garden"
feed_href := "https://tilde.town/~dozens/rsspect/feed.xml"
outfile := "feed.xml"
# show all available commands
default:
just --list
# update content submodule
fetch:
git submodule foreach git pull
# build feed.xml
build: fetch
#!/bin/sh
echo "Building xml file!!"
echo "<?xml version=\"1.0\" ?>" > {{outfile}}
echo "<rss version=\"2.0\" xmlns:atom=\"http://www.w3.org/2005/Atom\">" >> {{outfile}}
echo " <channel>" >> {{outfile}}
echo " <atom:link href=\"{{feed_href}}\" rel=\"self\" type=\"application/rss+xml\" />" >> {{outfile}}
echo " <title>{{feed_title}}</title>" >> {{outfile}}
echo " <link>{{feed_href}}</link>" >> {{outfile}}
echo " <description>{{feed_desc}}</description>" >> {{outfile}}
fd . 'src/' -e md -x pandoc -f markdown+autolink_bare_uris --template=feed.tmpl >> {{outfile}}
echo " </channel>" >> {{outfile}}
echo "</rss> " >> {{outfile}}
echo "Done building xml file \o/"
# upload feed.xml
up:
@echo "Uploading to server!!"
@rsync -azP feed.xml tilde:public_html/rsspect/
@echo "Done uploading to server \o/"
# build and upload
all: build up
@echo "Roger dodger, it's all done: you have tended your garden 🌱"