gardener/justfile

38 lines
1.1 KiB
Plaintext

# vars
feed_title := "confessions of a gardener"
feed_desc := "all about my dirty life and times"
feed_href := "https://example.com/weed/feed.xml"
outfile := "feed.xml"
# show all available commands
default:
just --list
# build feed.xml
build:
#!/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!!"
#@rsync -azP feed.xml server:www/weed/
@echo "Done uploading to server \o/"
# build and upload
all: build up
@echo "Roger dodger, it's all done: you have tended your garden 🌱"