From e77535b362933895c8634b41ed41efed5951e4a2 Mon Sep 17 00:00:00 2001 From: emmett1 Date: Mon, 22 Jun 2026 22:14:09 +0800 Subject: updated buildsite.sh and installation doc --- utils/buildsite.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'utils') diff --git a/utils/buildsite.sh b/utils/buildsite.sh index c5d8782f..7297dbb2 100755 --- a/utils/buildsite.sh +++ b/utils/buildsite.sh @@ -361,7 +361,8 @@ for f in docs/*.md; do case $f in */readme.md|*/index.md) continue;; esac title=$(head -n1 "$f" | sed "s/^#* *//") file=${f##*/} - echo "- [$title](./${file%.md}.html)" >> docs/index.md + file_no_num=$(printf '%s' "$file" | sed 's/^[0-9][0-9]-//') + echo "- [$title](./${file_no_num%.md}.html)" >> docs/index.md done cat >> docs/index.md << 'EOF' @@ -373,6 +374,7 @@ doc_files=$(ls docs/*.md 2>/dev/null | sort | grep -v /readme.md | grep -v /inde find . -type f -name "*.md" ! -path './public/*' | sed 's|^\./||' | while IFS= read -r i; do dir=${i%/*} file=${i##*/} + outfile=$(printf '%s' "$file" | sed 's/^[0-9][0-9]-//') title=${dir##*/} [ "$dir" = "$file" ] && { title=home; dir= @@ -388,7 +390,7 @@ find . -type f -name "*.md" ! -path './public/*' | sed 's|^\./||' | while IFS= r 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##*/} + next_html=$(printf '%s' "${next##*/}" | sed 's/^[0-9][0-9]-//') printf '\n
<- back to docs%s ->
\n' "${next_html%.md}.html" "$next_title" else printf '\n<- back to docs\n' @@ -398,7 +400,7 @@ find . -type f -name "*.md" ! -path './public/*' | sed 's|^\./||' | while IFS= r ;; esac cat files/footer - } > "public/${i%.md}.html" + } > "public/$dir/${outfile%.md}.html" done # move readme.html to index.html -- cgit v1.2.3