Starter template for Diagram Chasing data stories.
pnpm install
pnpm run devEdit src/lib/story.config.ts — the single place for all per-story config:
export const story: StoryConfig = {
canonicalUrl: 'https://diagramchasing.fun/YYYY/story-slug',
seoTitle: 'Story Title — Diagram Chasing',
seoDescription: '...',
shareTitle: 'Story Title',
shareDescription: '...',
shareImgPath: 'https://diagramchasing.fun/YYYY/story-slug/sharecard.jpg',
publishTime: '2025-01-01T00:00:00.000Z',
contributors: [
{ name: 'Name', link: 'https://diagramchasing.fun/authors/name', role: 'Reporting' }
],
keywords: ['india', 'data', '...']
};Pull the latest posts from diagramchasing.fun before building:
pnpm run fetch-rssDeploys to Netlify via GitHub Actions. Two workflows:
| Workflow | Trigger | Target |
|---|---|---|
netlify-pages-preview.yaml |
Push to main |
Preview deploy (alias: preview) |
netlify-pages-publish.yaml |
Manual (workflow_dispatch) |
Production deploy |
Set under Settings → Secrets and variables → Actions:
| Secret | Where to find it |
|---|---|
NETLIFY_AUTH_TOKEN |
Netlify → User settings → Personal access tokens |
NETLIFY_SITE_ID |
Netlify → Site → Site configuration → Site ID |
Set under Netlify → Site → Environment variables:
| Variable | Example | Purpose |
|---|---|---|
ANALYTICS_ID |
story-slug |
Plausible analytics domain |
BASE_URL |
https://story-slug.netlify.app/ |
Base href for static asset paths |
References live in src/lib/data/references.json as a CSL-JSON array. Minimum shape:
{
"id": "unique-key",
"type": "report",
"title": "Source Title",
"author": [{ "family": "Last", "given": "First" }],
"issued": { "date-parts": [[2024]] },
"publisher": "Publisher Name"
}Cite inline in .md files with [@unique-key]. The <Bibliography /> component renders the full reference list.