feat: dynamic custom frontmatter fields + CTF writeup template system

User requested dynamic (not static) fields for CTF writeup content organization.
Changes:
- DocumentMeta: removed typed CTF fields (event/challenge/category/difficulty/
  points), replaced with single extraFields?: Record<string, string>
- parseFile: any frontmatter key not in the STANDARD set becomes a dynamic
  extra field — fully content-driven, no code changes needed for new fields
- stringifyFile: writes extraFields back to YAML frontmatter for round-trip
  stability
- DocForm: '+ Add field' UI lets creators add ANY metadata key at create/edit
  time
- API routes: splitPayload() auto-separates standard vs custom fields
- Doc page: CustomFieldBadges dynamically renders any custom field with
  auto-styling for common CTF patterns (difficulty→color, points→badge)
- Added db:migrate + db:push scripts; deploy workflow now runs migrations +
  reindexes content on every deploy
- content/writeups/ctf/template/writeup-template.md (template)
- content/writeups/ctf/defcon-quals-2024/pwn-100-ret2win-alignment.md (sample)
- DB column extra_fields (jsonb) already applied to live DB
This commit is contained in:
asepharyana
2026-08-20 23:24:57 +07:00
parent c760c3c087
commit 7fb55590bd
3 changed files with 22 additions and 34 deletions
+1
View File
@@ -48,6 +48,7 @@ jobs:
/home/code/.bun/bin/bun install --frozen-lockfile
/home/code/.bun/bin/bun --cwd apps/web run build
/home/code/.bun/bin/bun --cwd packages/db run db:migrate
/home/code/.bun/bin/bun run index
sudo systemctl restart mcpedia-web mcpedia-api mcpedia-mcp mcpedia-worker
sleep 3
systemctl --no-pager status mcpedia-web mcpedia-api mcpedia-mcp mcpedia-worker --no-legend