Add automated docs sync pipeline from forge repo#14
Merged
initializ-mk merged 2 commits intomainfrom Apr 20, 2026
Merged
Conversation
- Create scripts/sync-docs.ts: fetches docs from initializ/forge via GitHub API, parses frontmatter, rewrites links to Astro routes, generates docs-manifest.json - Create scripts/sync-docs-stub.ts: generates placeholder docs for astro dev without GitHub access - Add sync:docs and sync:docs:stub scripts to package.json; sync:docs runs first in the fetch pipeline - Remove manually-maintained docs from git tracking (now generated at build time via sync:docs) - Update .gitignore to exclude synced docs directories
3 tasks
Triggers on repository_dispatch from forge repo (docs-updated event) or manual workflow_dispatch. Runs sync-docs.ts, commits any changes, and pushes — which triggers Cloudflare Pages auto-deploy.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
scripts/sync-docs.tsthat fetches docs frominitializ/forgevia GitHub API, parses YAML frontmatter, rewrites relative links to Astro routes, and generatesdocs-manifest.jsonscripts/sync-docs-stub.tsfor generating placeholder docs during local dev without GitHub accessnpm run sync:docsHow it works
getting-started/,core-concepts/, etc.) with YAML frontmatter — see forge PR branchsync-docs.tsfetches the git tree, downloads each.md, validates frontmatter, rewrites links, and writes tosrc/content/docs/sync:docsruns first in thefetchpipeline so docs exist before Astro processes other pagesastro devwithout network accessChanges
scripts/sync-docs.ts— main sync script (fetches, parses, rewrites, writes)scripts/sync-docs-stub.ts— dev stub generator (36 placeholder pages)package.json— addsync:docs,sync:docs:stub; sync:docs runs first infetch.gitignore— exclude synced docs directories and manifestTest plan
npx tsx scripts/sync-docs-stub.tsgenerates 36 placeholder docsnpx tsx scripts/sync-docs.tsfetches docs (once forge branch is merged)npm run buildsucceeds with synced/stub docs.gitignore, not tracked in gitdocs-manifest.jsongenerated with correct section counts