Start a new Diagram Chasing data story from this scaffold. It provides SEO, a footer with the latest posts, analytics, basepath handling, deploy workflows, and a project bootstrap script, so you can focus on the design and visualization work for each story.
- Install pnpm.
- Install the GitHub CLI and run
gh auth login. - Install the Netlify CLI and
run
netlify login.
-
Create a project from the scaffold and install dependencies:
npx degit diagram-chasing/svelte-starter my-story cd my-story pnpm install -
Run the setup script:
pnpm setup
The script prompts you for the story details and then:
- Rewrites
story.config.jsand the package name. - Creates the GitHub repo and pushes. The repo is private by default;
pass
--publicto override. - Creates the Netlify site and links the local checkout.
- Sets the
NETLIFY_AUTH_TOKENandNETLIFY_SITE_IDActions secrets. The token is a one-time personal access token cached in~/.config/diagram-chasing/. - Offers to append the proxy line to the sibling
../site/_redirects.
Pass
--dry-runto print every mutating command without executing it. The script is idempotent: if it fails partway, fix the cause and run it again. - Rewrites
-
Complete the remaining manual steps:
- Commit and deploy the studio site repo to activate the proxy.
- Replace
static/og/card.jpgwith the real share card. - Set
publishTimeinstory.config.jswhen the story launches. - After the story's post exists in the studio site repo, run
pnpm sync-standard-sitethere and copy theatproto:URI it writes intoatprotoDocumentinstory.config.js. This gives the story a "View publication" button on Bluesky.
pnpm dev: Start the dev server. No basepath is needed locally.pnpm build: Refresh redirects and latest posts, build the site, then inject the Standard.site link tags.pnpm preview: Serve the build. Visit/YYYY/slug, including the basepath.pnpm rss: Refresh the footer's latest-posts JSON.pnpm check: Run svelte-check.
Push to main to trigger a Netlify preview deploy. Run the Production
Deploy action to deploy to production. Both workflows accept
workflow_call, so a data-refresh cron can chain a deploy.
Change freely:
- Design tokens in
src/app.css, including colors and the--font-sansand--font-headinghooks. - Fonts.
- The story content in
src/lib/content.md. - Chart components in
$chartsand data in$data. - The UI kit in
src/lib/components/ui/.
Keep as-is:
- The shape of
story.config.js. src/lib/site.ts,SEO.svelte, andFooter.svelte. RestyleFooter.sveltethrough the shared tokens instead of rewriting it.scripts/,.github/workflows/, andnetlify.toml.- The
paths: { base, relative: false }block insvelte.config.js, which keeps asset URLs working behind the proxy.
For the full contract and pointers to advanced patterns such as data pipelines, crons, and per-page OG images, see CLAUDE.md.