diff options
author | iximeow <me@iximeow.net> | 2018-01-03 04:30:38 -0800 |
---|---|---|
committer | iximeow <me@iximeow.net> | 2018-01-03 04:30:38 -0800 |
commit | 10c8dd614eb672ca03eaae287554735adf62979f (patch) | |
tree | 1a77166e6cd50bb1e121e3f35b210fd37b7c3d7c /build_index.sh | |
parent | 254e5affeb387f63fc74913f7806b3e144d0e4f6 (diff) |
add makefile to streamline publishing, build_index to generate writing.html
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 |