gardener/justfile

42 lines
1.2 KiB
Plaintext
Raw Normal View History

2022-01-25 00:51:30 +00:00
# vars
2022-01-25 01:17:15 +00:00
feed_title := "dozens weed"
feed_desc := "my special little weed in my special little garden"
feed_href := "https://tilde.town/~dozens/rsspect/feed.xml"
2022-01-25 00:51:30 +00:00
outfile := "feed.xml"
# show all available commands
default:
just --list
2022-01-25 01:17:15 +00:00
# update content submodule
fetch:
git submodule foreach git pull
2022-01-25 00:51:30 +00:00
# build feed.xml
2022-01-25 01:17:15 +00:00
build: fetch
2022-01-25 00:51:30 +00:00
#!/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 --template=feed.tmpl >> {{outfile}}
echo " </channel>" >> {{outfile}}
echo "</rss> " >> {{outfile}}
echo "Done building xml file \o/"
# upload feed.xml
up:
@echo "Uploading to server!!"
2022-01-25 01:17:15 +00:00
@rsync -azP feed.xml tilde:public_html/rsspect/
2022-01-25 00:51:30 +00:00
@echo "Done uploading to server \o/"
# build and upload
all: build up
@echo "Roger dodger, it's all done: you have tended your garden 🌱"