diff options
-rw-r--r-- | Makefile | 6 | ||||
-rwxr-xr-x | build_index.sh | 19 |
2 files changed, 25 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..2ce6ec3 --- /dev/null +++ b/Makefile @@ -0,0 +1,6 @@ +generated/writing.html: + ./build_index.sh + +publish: generated/writing.html + rsync -av generated/ /home/iximeow/www.iximeow.net/ + echo "now go commit and push" diff --git a/build_index.sh b/build_index.sh new file mode 100755 index 0000000..b2f3654 --- /dev/null +++ b/build_index.sh @@ -0,0 +1,19 @@ +#! /usr/bin/env bash + +build_index() { + echo '<html><body>' + echo '<ul>' + for i in $(find generated/ -name '*.html'); do + if [ "$i" == "generated/writing.html" ]; then + continue + fi + real_path=${i#generated/} + filename=${real_path##*/} + title=${filename%.html} + echo "<li><a href=\"$real_path\">$title</a></li>" + done + echo '</ul>' + echo '</body></html>' +} + +build_index > generated/writing.html |