aboutsummaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authoremmett1 <me@emmett1.my>2026-06-09 00:10:01 +0800
committeremmett1 <me@emmett1.my>2026-06-09 00:10:01 +0800
commit62593dcd600bafbffdd6887a7daeba6e9f034a4e (patch)
tree038b22bbdbdbb700893b1b009af9756070de571f /utils
parent55bb51fb1b5756461b848ffb04366c4f4c9d5b63 (diff)
downloadalicelinux-62593dcd600bafbffdd6887a7daeba6e9f034a4e.tar.gz
alicelinux-62593dcd600bafbffdd6887a7daeba6e9f034a4e.zip
docs updated
Diffstat (limited to 'utils')
-rwxr-xr-xutils/buildsite.sh20
1 files changed, 19 insertions, 1 deletions
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 '<a href="/docs/">&lt;- back to docs</a>\n\n';; esac; esac
cmark "$i"
- case $i in docs/readme.md|docs/index.md) ;; *) case $i in docs/*) printf '\n<a href="/docs/">&lt;- back to docs</a>\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<div style="display:flex;justify-content:space-between;margin-top:1.5em"><a href="/docs/">&lt;- back to docs</a><a href="/docs/%s">%s -&gt;</a></div>\n' "${next_html%.md}.html" "$next_title"
+ else
+ printf '\n<a href="/docs/">&lt;- back to docs</a>\n'
+ fi
+ ;;
+ esac
+ ;;
+ esac
cat files/footer
} > "public/${i%.md}.html"
done