summaryrefslogtreecommitdiff
path: root/index.md.do
blob: 3155cb797977ecae827215d9558c9c2c34c68710 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env bash

LISTS=()
while read -r -d $'\0'; do
    LISTS+=("$REPLY")
done < <(find lists -maxdepth 1 -mindepth 1 -type d -not -name '.*' -print0 | sort -z)

for x in "${LISTS[@]}"; do
    printf "%s.html\0" "$x"
		printf "rss/%s.rss\0" "$(basename $x)"
done | xargs -r -0 redo-ifchange

cat <<EOF
% Index

This is a blog.
It contains things.
Send things to <blog@dirty-haskell.org> if you so choose.

EOF

for x in "${LISTS[@]}"; do
    printf "* [%s](%s) ([RSS](rss/%s))\n" "$(<$x/title)" "$x.html" "$(basename $x).rss"
    while read -r -d $'\n'; do
        printf "    %s\n" "$REPLY"
    done < "$x/preview"
done