Weekly is an Astro and Markdown static site for weekly posts.
Deploy surface: pushing main is production. Vercel builds and publishes weekly.tw93.fun automatically on every push; there is no staging.
src/pages/posts/- Chinese posts, one file per issue, named{issue-number}-{Chinese-title}.md.src/pages/en/posts/- English translations, matched to the Chinese post by the{issue-number}-filename prefix (the slug after the number may differ).src/- Astro source, shared utilities, and page components.public/- static assets;public/posts.jsonis generated bybuild.js.README.mdpost list,RECENT.md, andpublic/posts.json- all generated bybuild.js; do not hand-edit.scripts/- maintenance scripts, including image probing and translation helpers.- Machine-readable surfaces, all generated at build time from the same posts, never hand-edited:
src/agents.ts- issue metadata, Markdown twins (/posts/{n}.md,/en/posts/{n}.md),/index.md,/en/index.md.src/agentGuide.ts-/llms.txt,/llms.md,/api/llms.txt,/posts/llms.txt.src/pages/api/- read-only JSON API;src/pages/openapi.json.tsdescribes it;src/pages/feeds/posts.jsonl.tsandsrc/pages/schemamap.xml.tsare the structured-data feeds.src/aboutMarkdown.tsplussrc/data/about.*.mdandsrc/data/faq.ts- single source for/about,/en/aboutand their.mdtwins.public/.well-known/- RFC 9727 API catalog and the Agent Skills index;public/skills/- published SKILL.md.vercel.json- content types for.md/.jsonl/api-catalog, RFC 8288Linkheaders,/apirewrite,?mode=agentredirect.
.github/workflows/build.yml- daily and on-push workflow that runsbuild.js, commits regenerated indexes, and pings IndexNow. It does not deploy the site; Vercel does..github/workflows/translate-posts.yml- translates new Chinese posts on push (and manually).
pnpm install
pnpm dev
pnpm build
pnpm preview
pnpm image:probe
GROK_API_KEY=your_key node scripts/translate_posts.jspnpm build runs scripts/probe-images.js before the Astro build and pagefind after the build.
- Frontmatter:
date(formatYYYY/MM/DD) is required;imageis optional. The post title comes from the filename, not frontmatter. - Chinese posts:
src/pages/posts/{issue-number}-{Chinese-title}.md; English posts live insrc/pages/en/posts/keyed by the same issue-number prefix. Do not mix languages in a single file. - The site ships two language surfaces. Before changing any page-level metadata (share/OG title, description, social card), list both the Chinese and English copies plus the share-card fields, and sync all of them; the English site keeping a Chinese share title is the known failure this rule exists for.
- Preserve the author's voice: do not make colloquial phrasing formal, do not add emoji unless the original has them.
- Claims in the agent surfaces (
llms.txt,/llms.md,/about, JSON-LD, SKILL.md, agent-skills index) must stay checkable against the repo: issue counts come from the post set, the first issue is 2020/11/24, and the site has no write API, no auth and no sandbox. Do not advertise an endpoint, credential flow or MCP surface that does not exist.
- Do not delete existing posts or rewrite old content unless the task explicitly asks for it.
- Let
build.jsregenerateREADME.md,RECENT.md, andpublic/posts.jsonafter content changes; do not edit them by hand. - Keep generated files under
dist/out of commits. - Translation automation writes missing English posts under
src/pages/en/posts/; preserve Markdown and frontmatter shape. - Prefer small content or component edits with targeted verification.
- Site or content changes: run
pnpm build. For image-processing, translation, or frontmatter edits, also runpnpm devand inspect the affected pages yourself; a green build does not mean the page still looks right, and push is production. - Image-related changes: run
pnpm image:probeor rely on theprebuildstep. - Translation changes: verify
GROK_API_KEYis provided before runningscripts/translate_posts.js, then inspect generated English Markdown before committing. - Local visual checks: run
pnpm devand inspect the affected page. - Documentation-only changes: check links and commands.
- Use
ghfor issue and PR inspection. - Do not post public comments unless the maintainer explicitly asks.
- Draft public replies in the same language as the thread.