summaryrefslogtreecommitdiff
path: root/tools/html-to-atom.sh
blob: aa665b035ba467114b80df1f4c061477191db6ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh

# Composes an atom feed out of XHTML files.

BASEDIR=~/homepage
TOOLS="${BASEDIR}/tools"
SOURCES="${BASEDIR}/src"
ATOM="${BASEDIR}/atom.xml"

(echo '<?xml version="1.0" encoding="UTF-8"?>' &&
     echo '<list>' &&
     find "${BASEDIR}" -name '*.xhtml' |
         grep -Ev "^(${TOOLS}|${SOURCES}).*" |
         sed -e "sS^${BASEDIR}\(.*\)S<entry name=\"\\1\" />S" &&
     echo '</list>') |
    xsltproc "${TOOLS}/html-to-atom-dump.xsl" - |
    xsltproc "${TOOLS}/atom-sort.xsl" - |
    xsltproc "${TOOLS}/atom-limit.xsl" - |
    xmllint --format --nsclean - > "${ATOM}"