Background
The FAQ source (docs/faq/src/v3-faq-data.json, builder docs/faq/build.mjs) was originally written for v3 only. After the April 2026 reorg (PR #150 / #161) it now lives at v3/docs/faq/. Going forward we have multiple maintained generations (v2, v3, v4, …vN) and want a unified FAQ site that draws from all of them.
Goal
A FAQ data file per active version branch, plus a generator that lives on main and aggregates them into one published site — runnable on demand via a workflow.
Proposed design
1. Per-branch data files
Each branch holds only the FAQ entries that apply to its version:
| Branch |
Data file |
v2 |
v2/docs/faq/faq-data.json (new) |
v3 |
v3/docs/faq/faq-data.json (rename from v3-faq-data.json) |
v4 |
v4/docs/faq/faq-data.json (new) |
Data shape unchanged ({id, category, question, answer, tags, docs}) plus a per-file implicit version (filename / branch).
If we want a single entry to apply to multiple versions, support applies_to: ["v3","v4"] in each entry — the generator dedupes across branches by id, keeping the highest version by default and merging tags. (Open question — see below.)
2. Main-side generator
Lives at main:.github/scripts/faq/build-aggregate.mjs. It:
- For each
v* branch in a configurable list:
git show origin/<branch>:docs/faq/faq-data.json (or vN/docs/faq/faq-data.json)
- Parse and tag each entry with its source version
- Merge into a single
entries[], dedupe by id (keep newest version, log conflicts)
- Render through the existing
build.mjs template logic — output a single dist/index.html
- Emit a JSON manifest of which entries came from which branch (useful for diagnostics)
The HTML template gains a version filter toggle (alongside the existing category filter) so end users can scope the FAQ to a specific version.
3. Trigger workflow
main:.github/workflows/build-faq.yml:
workflow_dispatch (manual trigger; inputs: branches list, deploy yes/no)
- Optional
schedule: cron (weekly?)
- Optional
repository_dispatch so a v* CI can ping it after data file changes
Pipeline:
- Checkout
main
git fetch all v* branches
- Run
build-aggregate.mjs
- Validate output (
pnpm --prefix .github/scripts/faq run validate)
- If
deploy: true → flyctl deploy to https://sindri-faq.fly.dev (the existing site)
4. fly.toml ownership
Currently v3/docs/faq/fly.toml deploys the v3-only site. Move the deployment manifest to main:.github/scripts/faq/fly.toml (since deployment is a main-side concern now). Each v* branch keeps only its own data file + builder template.
Migration steps
- Per branch (separate PRs):
- v3: rename
v3/docs/faq/src/v3-faq-data.json → v3/docs/faq/faq-data.json. Strip site-build tooling that's moving to main.
- v2: extract v2-applicable entries from current data, place at
v2/docs/faq/faq-data.json.
- v4: seed with a small set of v4-only entries (or copy v3 entries with
applies_to and triage later).
- Main:
- Add
.github/scripts/faq/{build-aggregate.mjs, fly.toml, Dockerfile, src/index.html, src/faq.js} (template files moved from v3).
- Add
.github/workflows/build-faq.yml.
- Cutover:
- First triggered run validates dedupe behavior.
- Update https://sindri-faq.fly.dev to point to the aggregated build.
- Remove old v3-only
flyctl deploy route.
Open design questions
Non-goals
- Auto-deploy on every push (manual / scheduled only — keeps fly.io cost predictable).
- Per-version separate sites (one unified site is the goal).
Related
Background
The FAQ source (
docs/faq/src/v3-faq-data.json, builderdocs/faq/build.mjs) was originally written for v3 only. After the April 2026 reorg (PR #150 / #161) it now lives atv3/docs/faq/. Going forward we have multiple maintained generations (v2, v3, v4, …vN) and want a unified FAQ site that draws from all of them.Goal
A FAQ data file per active version branch, plus a generator that lives on
mainand aggregates them into one published site — runnable on demand via a workflow.Proposed design
1. Per-branch data files
Each branch holds only the FAQ entries that apply to its version:
v2v2/docs/faq/faq-data.json(new)v3v3/docs/faq/faq-data.json(rename fromv3-faq-data.json)v4v4/docs/faq/faq-data.json(new)Data shape unchanged (
{id, category, question, answer, tags, docs}) plus a per-file implicit version (filename / branch).If we want a single entry to apply to multiple versions, support
applies_to: ["v3","v4"]in each entry — the generator dedupes across branches byid, keeping the highest version by default and merging tags. (Open question — see below.)2. Main-side generator
Lives at
main:.github/scripts/faq/build-aggregate.mjs. It:v*branch in a configurable list:git show origin/<branch>:docs/faq/faq-data.json(orvN/docs/faq/faq-data.json)entries[], dedupe by id (keep newest version, log conflicts)build.mjstemplate logic — output a singledist/index.htmlThe HTML template gains a
version filtertoggle (alongside the existing category filter) so end users can scope the FAQ to a specific version.3. Trigger workflow
main:.github/workflows/build-faq.yml:workflow_dispatch(manual trigger; inputs: branches list, deploy yes/no)schedule:cron (weekly?)repository_dispatchso a v* CI can ping it after data file changesPipeline:
maingit fetchallv*branchesbuild-aggregate.mjspnpm --prefix .github/scripts/faq run validate)deploy: true→flyctl deployto https://sindri-faq.fly.dev (the existing site)4. fly.toml ownership
Currently
v3/docs/faq/fly.tomldeploys the v3-only site. Move the deployment manifest tomain:.github/scripts/faq/fly.toml(since deployment is a main-side concern now). Eachv*branch keeps only its own data file + builder template.Migration steps
v3/docs/faq/src/v3-faq-data.json→v3/docs/faq/faq-data.json. Strip site-build tooling that's moving to main.v2/docs/faq/faq-data.json.applies_toand triage later)..github/scripts/faq/{build-aggregate.mjs, fly.toml, Dockerfile, src/index.html, src/faq.js}(template files moved from v3)..github/workflows/build-faq.yml.flyctl deployroute.Open design questions
applies_to: [v3, v4]in the data, or strict per-branch ownership (entry only lives on the branch it applies to, no overlap allowed)?idappears on multiple branches with different content — fail the build, take the newer branch, or merge with a separator?main:.github/scripts/faq/schema/faq-data.schema.json? Currentlyvalidate-faq.shuses simple regex.Non-goals
Related
docs/REPO_REORG_PLAN.mdpre-reorg-2026-04-25