diff --git a/scripts/gen-index.sh b/scripts/gen-index.sh index 42691a4..9d8b4bd 100644 --- a/scripts/gen-index.sh +++ b/scripts/gen-index.sh @@ -9,23 +9,10 @@ WIKI_DIR="$(cd "$(dirname "$0")/../wiki" && pwd)" INDEX="$WIKI_DIR/../index.md" # ─── Branch order and display names ─── -# Edit this array for your branches. Leave empty (declare -a BRANCHES=()) -# to auto-discover by filename prefix and capitalize display names automatically. -# -# Reference implementation uses these 11 branches in this order: -declare -a BRANCHES=( - "harness-engineering|Harness Engineering" - "mcp|MCP" - "ai-skills|AI Skills" - "vibe-coding|Vibe Coding" - "ai-agent|AI Agent" - "self-media|Self-Media" - "product-business|Product & Business" - "claude-code|Claude Code" - "context-engineering|Context Engineering" - "career-mindset|Career & Mindset" - "developer-workflow|Developer Workflow" -) +# Edit this array once your branch set stabilizes. Empty array = auto-discover +# branches by filename prefix (everything before first hyphen), and capitalize +# display names automatically. +declare -a BRANCHES=() # ─── Auto-discover branches if not overridden ─── if [ ${#BRANCHES[@]} -eq 0 ]; then diff --git a/scripts/lint.sh b/scripts/lint.sh index 1d3229a..8f0a18a 100644 --- a/scripts/lint.sh +++ b/scripts/lint.sh @@ -19,7 +19,7 @@ for f in "$WIKI_DIR"/*.md; do [ -f "$f" ] || continue slug=$(basename "$f" .md) # Skip index and log - [[ "$slug" == "index" || "$slug" == "log" ]] && continue + [[ "$slug" == "index" || "$slug" == "log" || "$slug" == "_template" || "$slug" == "README" ]] && continue SLUGS["$slug"]=1 done @@ -32,7 +32,7 @@ FOUND_GHOST=0 for f in "$WIKI_DIR"/*.md; do [ -f "$f" ] || continue slug=$(basename "$f" .md) - [[ "$slug" == "index" || "$slug" == "log" ]] && continue + [[ "$slug" == "index" || "$slug" == "log" || "$slug" == "_template" || "$slug" == "README" ]] && continue # Extract all [[...]] links while IFS= read -r link; do @@ -66,7 +66,7 @@ done for f in "$WIKI_DIR"/*.md; do [ -f "$f" ] || continue slug=$(basename "$f" .md) - [[ "$slug" == "index" || "$slug" == "log" ]] && continue + [[ "$slug" == "index" || "$slug" == "log" || "$slug" == "_template" || "$slug" == "README" ]] && continue while IFS= read -r link; do target="${link%%|*}" @@ -97,7 +97,7 @@ FOUND_FORMAT=0 for f in "$WIKI_DIR"/*.md; do [ -f "$f" ] || continue slug=$(basename "$f" .md) - [[ "$slug" == "index" || "$slug" == "log" ]] && continue + [[ "$slug" == "index" || "$slug" == "log" || "$slug" == "_template" || "$slug" == "README" ]] && continue # 3a. First line must be # title first_line=$(head -1 "$f") @@ -135,7 +135,7 @@ PATTERNS='最新版|目前最新|currently v|latest v|just released|剛出|剛 for f in "$WIKI_DIR"/*.md; do [ -f "$f" ] || continue slug=$(basename "$f" .md) - [[ "$slug" == "index" || "$slug" == "log" ]] && continue + [[ "$slug" == "index" || "$slug" == "log" || "$slug" == "_template" || "$slug" == "README" ]] && continue matches=$(grep -nE "$PATTERNS" "$f" 2>/dev/null) if [ -n "$matches" ]; then