aboutsummaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorCem Keylan <cem@ckyln.com>2020-08-03 23:36:01 +0300
committerCem Keylan <cem@ckyln.com>2020-08-03 23:36:01 +0300
commitf0b208e0d7875ba91b9733b30d73b0ac20c10070 (patch)
tree7a38f6112349c859632b5fe5673db3ced66a137a /build
parentec7e9e3183492bcd18d06c02b90930f6a837c6b5 (diff)
downloadwebsite-f0b208e0d7875ba91b9733b30d73b0ac20c10070.tar.gz
update
Diffstat (limited to 'build')
-rwxr-xr-xbuild14
1 files changed, 12 insertions, 2 deletions
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