diff options
| author | emmett1 <me@emmett1.my> | 2026-06-22 22:14:09 +0800 |
|---|---|---|
| committer | emmett1 <me@emmett1.my> | 2026-06-22 22:14:09 +0800 |
| commit | e77535b362933895c8634b41ed41efed5951e4a2 (patch) | |
| tree | 2e8c6bc3ff3bc8bfb75c5ff4daae818115316215 /utils | |
| parent | 5c618c1aeb65b4b05956d7f7574691d15896c103 (diff) | |
| download | alicelinux-e77535b362933895c8634b41ed41efed5951e4a2.tar.gz alicelinux-e77535b362933895c8634b41ed41efed5951e4a2.zip | |
updated buildsite.sh and installation doc
Diffstat (limited to 'utils')
| -rwxr-xr-x | utils/buildsite.sh | 8 |
1 files changed, 5 insertions, 3 deletions
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<div style="display:flex;justify-content:space-between;margin-top:1.5em"><a href="/docs/"><- back to docs</a><a href="/docs/%s">%s -></a></div>\n' "${next_html%.md}.html" "$next_title" else printf '\n<a href="/docs/"><- back to docs</a>\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 |