From 62593dcd600bafbffdd6887a7daeba6e9f034a4e Mon Sep 17 00:00:00 2001 From: emmett1 Date: Tue, 9 Jun 2026 00:10:01 +0800 Subject: docs updated --- utils/buildsite.sh | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'utils/buildsite.sh') diff --git a/utils/buildsite.sh b/utils/buildsite.sh index ccaab39e..c5d8782f 100755 --- a/utils/buildsite.sh +++ b/utils/buildsite.sh @@ -363,8 +363,13 @@ for f in docs/*.md; do file=${f##*/} echo "- [$title](./${file%.md}.html)" >> docs/index.md done +cat >> docs/index.md << 'EOF' + +Documentation improvements are welcome. Visit the [docs directory](https://codeberg.org/emmett1/alicelinux/src/branch/main/docs) to contribute. +EOF # convert markdown to html +doc_files=$(ls docs/*.md 2>/dev/null | sort | grep -v /readme.md | grep -v /index.md || true) find . -type f -name "*.md" ! -path './public/*' | sed 's|^\./||' | while IFS= read -r i; do dir=${i%/*} file=${i##*/} @@ -378,7 +383,20 @@ find . -type f -name "*.md" ! -path './public/*' | sed 's|^\./||' | while IFS= r sed "s/@TITLE@/$title/g" files/header case $i in docs/readme.md|docs/index.md) ;; *) case $i in docs/*) printf '<- back to docs\n\n';; esac; esac cmark "$i" - case $i in docs/readme.md|docs/index.md) ;; *) case $i in docs/*) printf '\n<- back to docs\n';; esac; esac + case $i in docs/readme.md|docs/index.md) ;; *) + case $i in docs/*) + next=$(printf '%s\n' "$doc_files" | grep -FA1 "$i" | tail -n1) + if [ "$next" ] && [ "$next" != "$i" ]; then + next_title=$(head -n1 "$next" | sed 's/^#* *//') + next_html=${next##*/} + printf '\n
<- back to docs%s ->
\n' "${next_html%.md}.html" "$next_title" + else + printf '\n<- back to docs\n' + fi + ;; + esac + ;; + esac cat files/footer } > "public/${i%.md}.html" done -- cgit v1.2.3