Hacker News 文章 AI 翻译工具,将英文文章自动翻译成中文并生成 HTML 页面。
全部使用 Cursor AI 编写,just some code only written once.
export GOOGLE_API_KEY=<your-api-key>
uv run src/main.py
pnpm start ./hn_stories.json ./output && npx serve output
To generate HTML pages for all weekly archives stored in R2:
# Process new articles and generate all weekly pages
pnpm start ./hn_stories.json ./output --all-weeks
# Only generate all weekly pages without processing new articles
pnpm generate-all-weeks ./output
This will:
- Pull all weekly JSON files from R2 storage
- Generate HTML pages for each week
- Update the history index page with links to all weeks