# How to Live Better — Hong Kong & United Kingdom

**高性價比人生指南（香港／英國）** — bilingual **繁體中文 (zh-Hant)** and **English**.

A private static site with two region editions (Hong Kong | United Kingdom) and a language toggle on both. Adapted from [eternity4719/HowToLiveBetter](https://github.com/eternity4719/HowToLiveBetter) (Unlicense / public domain). Keep that credit.

This is **not** a translation of mainland-China law or welfare. Jurisdiction chapters were rewritten for HA / DH / MPF / Employment Ordinance (Hong Kong) and NHS / NICE / GOV.UK / Universal Credit (United Kingdom). Universal health evidence (NEJM, Lancet, WHO, Cochrane) is kept when it is not China-specific.

---

## 免責聲明 / Disclaimer

This site is **not legal, medical, tax or investment advice**. Items summarise public official documents and peer-reviewed papers so you can check the originals. Law and benefits change. Amounts, deadlines and eligibility follow the official text in force at the time. Uncertain items are marked **待核實 / to verify**. For emergencies call **999** in Hong Kong or the United Kingdom.

本站**不是**法律、醫療、稅務或投資意見。有急症先打 **999**。

---

## Local preview

```bash
npm run build      # validates JSON and copies a static site into dist/
npm run preview    # build, then serve dist/ at http://localhost:4173/
npm run validate   # JSON checks only
```

Or, after `npm run build`, open any static server on `dist/` (for example `python3 -m http.server 4173 --directory dist`). Do **not** open `index.html` as `file://` — the page fetches JSON.

---

## Cloudflare Pages

Suggested project name: **`howto-live-better-hk-uk`**.

From a machine with Wrangler:

```bash
npm run build
npx wrangler pages deploy dist --project-name howto-live-better-hk-uk
```

Dashboard alternative: connect this repo, **build command** `npm run build`, **output directory** `dist`. No Node dependencies are required at runtime; Node ≥ 18 is only used to copy and validate files.

---

## What v1 covers

Search and filters follow the upstream index: keyword, one chapter at a time, evidence grade A/B/C, money / time / willpower costs, value band, and “what you get back” (years / money / time / liberty). Items stay in cost-effectiveness order.

| ID | 繁中 | English |
| --- | --- | --- |
| 01 | 不要早死 | Don't die early |
| 02 | 不要慢慢死 | Don't die slowly |
| 05 | 不要浪費錢 | Don't waste money |
| 07 | 沒錢的時候怎麼活 | When you have no money |
| 09 | 普通人容易踩的法律紅線 | Legal red lines for ordinary people |
| 13 | 緊急情況 | Emergencies |
| 14 | 帳號與資訊安全 | Account and information security |
| 15 | 租房與買房 | Renting and buying a home |
| 19 | 在職、離職與工傷 | Work, leaving a job, workplace injury |
| 24 | 看病 | Seeing a doctor |

Each region has real local items (not stubs) in **both** languages. v1 does **not** attempt all 498 upstream items.

---

## Repository layout

```
content/i18n.json     UI strings (zh-Hant + en)
content/hk.json       Hong Kong chapters + items
content/uk.json       United Kingdom chapters + items
index.html            Site shell
css/app.css           Styles
js/app.js             Search, filters, region/lang (no full reload)
scripts/build.mjs     Validate + copy to dist/
scripts/write_content.py  Regenerates the two JSON files
LICENSE               Unlicense + attribution
```

Region (`?r=hk|uk`) and language (`?lang=zh-Hant|en`) live in the query string and `localStorage`. Switching language re-renders copy from data already in memory. Switching region swaps the in-memory pack and rebuilds cards. Neither path uses `location.reload()`.

### Item shape

```json
{
  "id": "05-02",
  "chapter": "05",
  "n": 2,
  "grade": "A",
  "money": "0",
  "time": "low",
  "will": "no",
  "level": "high",
  "lens": "money",
  "title": { "zh-Hant": "…", "en": "…" },
  "human": { "zh-Hant": "…", "en": "…" },
  "cost": { "zh-Hant": "…", "en": "…" },
  "gain": { "zh-Hant": "…", "en": "…" },
  "note": { "zh-Hant": "…", "en": "…" },
  "src": "Official URL or DOI …"
}
```

Cost tags: `money` = `0` | `low` | `high`; `time` = `low` | `mid` | `high`; `will` = `no` | `some` | `yes`. Benefit size `level` = `high` | `mid` | `low`. Lens = `mortality` | `money` | `time` | `freedom`. Evidence `grade` = `A` | `B` | `C` (same legend as upstream). Set `"todo": true` or write 待核實 / to verify when a figure is unchecked. Set `"dispute": true` when sources disagree.

Value band is computed in the page (not stored): high benefit + zero cost tags → extreme; otherwise high / ordinary, comparable **only inside the same lens**.

### How to add a chapter

1. Add the chapter `id`, bilingual `title` and `intro` to **both** `content/hk.json` and `content/uk.json` (or only one region if it truly does not apply).
2. Append items with the shape above. Prefer official sources: [gov.hk](https://www.gov.hk/), [legislation.gov.hk](https://www.legislation.gov.hk/), [GOV.UK](https://www.gov.uk/), [NHS](https://www.nhs.uk/), [NICE](https://www.nice.org.uk/), WHO, and papers with a DOI.
3. All user-facing Chinese must be **Traditional Chinese**, Hong Kong wording where possible. Do not paste 社保 / 醫保 / 公積金 / 勞動仲裁 / 三級醫院 / 戶口 as if they applied.
4. Prefer fewer accurate items over many invented statutes or fine amounts.
5. Run `npm run validate` then `npm run build`.

If you prefer to regenerate from the Python authoring file: edit `scripts/write_content.py` and run `python3 scripts/write_content.py`.

---

## Evidence legend

| Grade | Meaning |
| --- | --- |
| **A** | Quantified evidence from a meta-analysis, large cohort or randomised trial |
| **B** | Research exists but is hard to quantify, or a small / single study |
| **C** | Practical consensus or official how-to guidance, no direct effect-size paper |

---

## Attribution

- Upstream: [eternity4719/HowToLiveBetter](https://github.com/eternity4719/HowToLiveBetter), Unlicense.
- This adaptation is also Unlicense. See `LICENSE`.
- Official names (Hospital Authority, 衞生署, NHS, HMRC, …) remain those organisations’ marks.

---

## 中文說明（結構）

本倉庫是一份私人靜態站：同一套搜尋介面，兩個地區版本（香港｜英國），每個版本都有 **繁體中文** 與 **English**。上游 498 條不會一次搬完；第 1 版只覆蓋上表十個最高回報章節，並且把管轄權條目改寫成港／英制度。

請勿把內地法例或福利寫成「本地適用」。新增章節的方法見上文 How to add a chapter。部署指令與建議專案名稱見 Cloudflare Pages 一節。
