mirror of
https://github.com/prompt-security/clawsec.git
synced 2026-06-13 13:38:03 +03:00
fefecaa60a
* feat(wiki): add full in-app wiki browser and llms index * feat(wiki): auto-generate per-page llms exports * vuln package * fix(wiki): guard malformed route decoding * fix(wiki): preserve markdown anchor fragments across page links * refactor(markdown): share default render components * fix(wiki): block unsafe markdown link schemes * fix(wiki): block unsafe markdown image schemes * docs(wiki): migrate root docs into wiki pages * chore(wiki): de-track generated llms exports * chore(wiki): ignore generated public wiki artifacts * fix(wiki): align llms urls with per-page endpoint pattern * fix(wiki): derive llms index from wiki index page * refactor(markdown): share frontmatter and title helpers * refactor(wiki): share route and llms path mapping * ci(pages): add pr verify workflow and tighten deploy triggers
32 lines
889 B
Bash
Executable File
32 lines
889 B
Bash
Executable File
#!/bin/bash
|
|
# populate-local-wiki.sh
|
|
# Generates wiki-derived public assets for local preview and CI parity.
|
|
#
|
|
# Usage: ./scripts/populate-local-wiki.sh
|
|
|
|
set -euo pipefail
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
|
|
WIKI_DIR="$PROJECT_ROOT/wiki"
|
|
PUBLIC_WIKI_DIR="$PROJECT_ROOT/public/wiki"
|
|
|
|
if [ ! -d "$WIKI_DIR" ]; then
|
|
echo "Error: wiki directory not found at $WIKI_DIR"
|
|
exit 1
|
|
fi
|
|
|
|
echo "=== ClawSec Local Wiki Populator ==="
|
|
echo "Project root: $PROJECT_ROOT"
|
|
|
|
node "$PROJECT_ROOT/scripts/generate-wiki-llms.mjs"
|
|
|
|
PAGE_COUNT=0
|
|
if [ -d "$PUBLIC_WIKI_DIR" ]; then
|
|
PAGE_COUNT=$(find "$PUBLIC_WIKI_DIR" -type f -path '*/llms.txt' ! -path "$PUBLIC_WIKI_DIR/llms.txt" | wc -l | tr -d ' ')
|
|
fi
|
|
|
|
echo "Wiki llms index: $PUBLIC_WIKI_DIR/llms.txt"
|
|
echo "Wiki llms pages: $PAGE_COUNT files under $PUBLIC_WIKI_DIR/<page>/llms.txt"
|