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 | |
parent | 254e5affeb387f63fc74913f7806b3e144d0e4f6 (diff) |
add makefile to streamline publishing, build_index to generate writing.html
-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 |