#!/bin/sh
# Composes an atom feed out of XHTML files.
BASEDIR=~/homepage
TOOLS="${BASEDIR}/tools"
SOURCES="${BASEDIR}/src"
ATOM="${BASEDIR}/atom.xml"
(echo '' &&
echo '' &&
find "${BASEDIR}" -name '*.xhtml' |
grep -Ev "^(${TOOLS}|${SOURCES}).*" |
sed -e "sS^${BASEDIR}\(.*\)SS" &&
echo '
') |
xsltproc "${TOOLS}/html-to-atom-dump.xsl" - |
xsltproc "${TOOLS}/atom-sort.xsl" - |
xsltproc "${TOOLS}/atom-limit.xsl" - |
xmllint --format --nsclean - > "${ATOM}"