Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 4 additions & 17 deletions scripts/gen-index.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions scripts/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down Expand Up @@ -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%%|*}"
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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
Expand Down