# Deploy site to Cloudflare Pages

**https://doadzikir.novalagung.com**

## One-time setup

```sh
npm install
npx wrangler login
```

Create the Pages project (first time only):

```sh
npx wrangler pages project create doadzikir --production-branch=main
```

In Cloudflare dashboard → **Workers & Pages** → **doadzikir** → **Custom domains** → add `doadzikir.novalagung.com`, then set DNS (CNAME to the `*.pages.dev` host Cloudflare shows).

---

## Deploy (CLI)

From the repo root:

```sh
npm run deploy:page
```

This runs `build:page` (markdown → HTML) then uploads the `pages/` folder to Cloudflare Pages.

Preview deployment (optional branch URL):

```sh
npm run build:page
npx wrangler pages deploy pages --project-name=doadzikir --branch=preview
```

---

## Deploy (Git — automatic)

Connect the GitHub repo in Cloudflare → **Create application** → **Pages** → link `novalagung/doadzikir`:

| Setting | Value |
|---------|--------|
| Production branch | `main` |
| Build command | `npm run build:page` |
| Build output directory | `pages` |

Pushes to `main` deploy automatically; use CLI when you want to deploy without pushing.

---

## Local preview

```sh
npm run build:page
npx --yes serve pages -p 8788
```

Open http://localhost:8788

---

## Source files

| Edit | Generated on build |
|------|---------------------|
| `pages/privacy-policy.md` | `privacy-policy.html` |
| `pages/index.html` | (static) |

**Privacy policy URL (App Store & Play Console):** https://doadzikir.novalagung.com/privacy-policy.html
