English | 简体中文
delang turns any article URL into a clean, translated reading page.
delang.domain/https://url: Just read, with typeset's fine-tuned style.delang.domain/lang/https://url: Translate tolang.langis directly sent to LLM so specify anything you like for fun.
delang.domain/(lang)/https://news.ycombinator.com/item?id=...We offer special support for Hacker News, which aggregates the original article, a summary of the comments section, and the full text of the comments.- Detection (
isHnIteminworker/index.ts) keys on hostnamenews.ycombinator.com+ path/item; everything else uses the plain extract/translate path.
- Detection (
- Press
dto toggle light/dark mode. It detects your system theme too.
- Retrieve the Markdown using defuddle.
- If a language is specified, translate it using Gemini; by default, the Gemini Flash Lite model is used.
- Render the Markdown using Streamup; the styling is determined by shadcn/typeset. You can adjust and preview it here, then modify typeset.css in the codebase.
pnpm install
# vite dev (Worker runs via @cloudflare/vite-plugin)
pnpm devCreate your local secrets file (gitignored):
cp ".dev copy.example" .dev.vars # then fill in GEMINI_API_KEY="...".dev.vars holds GEMINI_API_KEY for local dev. It's gitignored (.dev.vars* is ignored, .dev.vars.example is kept).
delang deploys as a single Worker. The committed wrangler.jsonc is shared and contains no routes, so pnpm deploy pushes to a route-less Worker (reachable on its workers.dev subdomain).
-
Copy the example and edit the route to your domain:
cp wrangler.personal.jsonc.example wrangler.personal.jsonc # edit wrangler.personal.jsonc: set "pattern" under "routes" to your domainwrangler.personal.jsoncis gitignored. -
Set the production secret:
wrangler secret put GEMINI_API_KEY # paste the value from your .dev.varsVerify it's set:
wrangler secret list.
# build + deploy Worker with your custom-domain route
pnpm deploy:personalwrangler deploy / wrangler secret put need Cloudflare auth. Do one of:
wrangler loginin an interactive terminal, orexport CLOUDFLARE_API_TOKEN=<token>in the environment.
pnpm deploy(committedwrangler.jsonc, no routes):@cloudflare/vite-plugingenerated.wrangler/deploy/config.json, which redirectswrangler deployto the pre-builtdist/delang/wrangler.json. You'll seeUsing redirected Wrangler configurationin the output. Good for a route-less/workers.devpreview deploy and for anyone who forks the repo.pnpm deploy:personal(wrangler.personal.jsonc, your route):--configreads that file, so yourroutesfield is what gets sent to Cloudflare and your custom domain is attached on deploy.
If you just want to check a build without deploying, dry-runs need no auth:
pnpm exec wrangler deploy --dry-run
pnpm exec wrangler deploy --config wrangler.personal.jsonc --dry-run
