webring/justfile

50 lines
960 B
Plaintext

# list all recipes
default:
just --list --unsorted
# add a new webring member
new:
#!/usr/bin/env sh
read -p "name (lowercase, 3-13 characters): " name
read -p "title: " title
read -p "url: " url
read -p "feed: " feed
recins --verbose -t member \
-f "name" -v "$name" \
-f "title" -v "$title" \
-f "url" -v "$url" \
-f "feed" -v "$feed" \
db/members.rec
alias add := new
# rec2json
_json:
recsel db/members.rec \
| rec2csv \
| csvjson \
| jq '. | {data: .}'
# build html
html:
recsel db/members.rec \
| rec2csv \
| csvjson \
| jq '. | {data: .}' \
| mustache - src/example.html www/index.html
# build opml
opml:
recsel db/members.rec \
| rec2csv \
| csvjson \
| jq '. | {data: .}' \
| jq '{ data: [ .data[] | select(.feed != null) ] }' \
| mustache - src/example.opml www/webring.opml
# compile html and opml
build: html opml
# upload
up:
rsync -zaP www/ tilde:public_html/webring/dozens