blob: c84c50b5184ba57925477bee84af4bda4a51a21e (
plain) (
blame)
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
28
|
#!/bin/sh
set -euo pipefail
usage() {
echo 'Usage: categoriesbody FILENAME.conf'
}
FILENAME="${1:-}"
eval "$(assert-arg -- "$FILENAME" 'FILENAME.conf')"
. ./"$FILENAME"
DIR="$(dirname -- "$FILENAME")"
for catsortdata in `cat "$DIR"/categories.txt`; do
category="$(basename -- "$catsortdata" | cut -d. -f2)"
feedname=feed."$category".xml
cat <<EOF
<h2 id="$category">
<a href="#$category">$category</a>
<a href="$feedname">
<source srcset="$feedicon_url_prefix/dark.svg" media="(prefers-color-scheme: dark)" />
<img src="$feedicon_url_prefix/light.svg" class="icon" />
</a>
</h2>
EOF
mkwb indexbody "$FILENAME" "$catsortdata"
done
|