2023-11-13 13:42:05 -07:00
# show all options
default :
just --list --unsorted
# build html from markdown
html :
pandoc -f markdown+autolink_bare_uris -t html --standalone -H templates/header-includes.html --toc -o www/index.html src/piblog.md
# build rss feed from journal
rss :
#!/usr/bin/env sh
2023-11-16 15:13:00 -07:00
exec > wwww/feed.xml
echo "<rss version=\"2.0\"><channel><title>piblog</title>"
echo "<link>http://tilde.town/~dozens/piblog/index.html</link><description>just a little log about my raspberry pi</description><atom:link rel=\"self\" type=\"application/rss+xml\" href=\"http://tilde.town/~dozens/piblog/feed.xml\"/>"
ed -s !'markdown src/piblog.md' << HEREDOC | recfmt -f templates/feeditem.template | m4
2023-11-13 13:42:05 -07:00
/BEGIN/ka
/END/kb
1,' ad
' b,d
g/^<h2>/+s/^/note: /
v/^note/s/^/+ /
%s/+ <h2>/<h2>/
%s_^<h2><time>\( .*\) </time> - \( .*\) </h2>_\\
time: \1 \\
title: \2 _
g/^+ $/d
,w /dev/stdout
Q
HEREDOC
2023-11-16 15:13:00 -07:00
echo '</channel></rss>'
2023-11-13 13:42:05 -07:00
# watch for changes
watch :
ls src/piblog.md | entr just html
# build html and rss
build : html rss
# upload
up :
rsync -zaP www/ tilde:public_html/piblog
# build and upload
all : build up