diff options
Diffstat (limited to 'build_index.sh')
-rwxr-xr-x | build_index.sh | 19 |
1 files changed, 19 insertions, 0 deletions
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 |