ljsdev-ssg

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

commit 6629a581359cbe82557f10434adc1a62616ea0e5
parent 2b8163217d66e17e891d14430ff47105208bfb9a
Author: Leon <leon@wp2static.com>
Date:   Mon, 19 Aug 2019 08:55:06 +0200

article list generator

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

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