ljsdev-ssg

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit a39efa69314b8b7e5bcc26a523796b03c7f78d40
parent a178c56c9979f24102fd978646fd81817c56a4c3
Author: Leon <leon@wp2static.com>
Date:   Mon, 19 Aug 2019 09:55:30 +0200

generate indices

Diffstat:
Mgenerate-article-list.sh | 24++++++++++++++++++++++++
1 file changed, 24 insertions(+), 0 deletions(-)

diff --git a/generate-article-list.sh b/generate-article-list.sh @@ -11,3 +11,27 @@ for file in src/blog/*.html; done echo "</ul>" >> dst/blog.html + +# build essays index +echo "<ul>" >> dst/essays.html + +for file in src/essays/*.html; + do + article=`ls "$file" | sed 's|^src/essays/||'`; + title=`head -n 1 "$file" | sed -e 's/<h1>\(.*\)<\/h1>/\1/'` + echo "<li><a href=\"$article\">$title</a></li>" >> dst/essays.html; +done + +echo "</ul>" >> dst/essays.html + +# build dev-notes index +echo "<ul>" >> dst/dev-notes.html + +for file in src/dev-notes/*.html; + do + article=`ls "$file" | sed 's|^src/dev-notes/||'`; + title=`head -n 1 "$file" | sed -e 's/<h1>\(.*\)<\/h1>/\1/'` + echo "<li><a href=\"$article\">$title</a></li>" >> dst/dev-notes.html; +done + +echo "</ul>" >> dst/dev-notes.html