From f0b208e0d7875ba91b9733b30d73b0ac20c10070 Mon Sep 17 00:00:00 2001 From: Cem Keylan Date: Mon, 3 Aug 2020 23:36:01 +0300 Subject: update --- build | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'build') diff --git a/build b/build index 05b2322..85c74b6 100755 --- a/build +++ b/build @@ -72,7 +72,7 @@ blog_index() { printf '* %s - [%s](%s)\n' \ "$(date --date="$postdate" +%b\ %d\ %Y)" \ "$(gettitle "$post")" \ - "$(printf "$post" | sed 's#src/blog/##;s/.md/.html/')" + "${postdate}.html" done >> src/blog/index.md } @@ -90,6 +90,16 @@ site_index() { done } +docs_index() ( + cp templates/docs-index src/docs.md + find src/docs ! -name .git ! -name README | sort | while read -r file; do + case "$file" in src/docs) continue; esac + [ -d "$file" ] && printf '### %s\n' "${file#src/docs/}" && continue + filedest=${file#src} filedest=${filedest%.*}.html + printf '[%s](%s)\n' "$(gettitle "$file")" "$filedest" + done >> src/docs.md +) + genrss() { find "$1" -type f ! -name index.md | sort -r | while read -r post ; do postdate="${post##*/}" ; postdate="${postdate%.*}" @@ -118,7 +128,7 @@ main() { rm -rf docs; mkdir -p docs # Generate the indexes for blog and the wiki - site_index; blog_index + site_index; blog_index; docs_index # Generate rss feeds genrss index news index.html > src/news.xml -- cgit v1.2.3