You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Both `issues_dir` and `attachments_dir` default to `.` in the init template. Only change them if your Markdown files or images live in a different directory.
55
60
56
61
The site URL is computed automatically: `https://{domain}` if a custom domain is set, otherwise `https://{project}.pages.dev`.
57
62
@@ -84,7 +89,7 @@ Create `.env` in the newsletter directory:
84
89
CLOUDFLARE_API_TOKEN=<token>
85
90
```
86
91
87
-
Never put real tokens in `laughing-man.yaml` if the repo is public.
92
+
The init template writes placeholder values (`cf_xxxxx`, `re_xxxxx`) in the yaml's `env:` section. You can leave them as-is or remove the `env:` block entirely. The `.env` file takes priority over the yaml values.
88
93
89
94
This env var is used by both `setup web` (Cloudflare SDK) and `deploy` (wrangler). No separate `wrangler login` is needed.
90
95
@@ -160,15 +165,16 @@ If the user is using an apex domain (e.g., `example.com` rather than `newsletter
160
165
This is expected and correct. Apex domains require:
161
166
162
167
1. The domain must be a Cloudflare zone on the same account (nameservers pointed to Cloudflare).
163
-
2. The custom domain must be added through Pages *before* the CNAME is created (our `setup web` does this in the right order). Doing it backwards causes a 522 error.
168
+
2. The custom domain must be added through Pages _before_ the CNAME is created (our `setup web` does this in the right order). Doing it backwards causes a 522 error.
164
169
3. Cloudflare automatically flattens the apex CNAME (resolves it to the final IP) on all plans.
[ok] Sender domain "send.example.com" exists (status: verified) # or "created" if new
187
+
[ok] Sender domain "send.example.com" exists (status: verified) # or "created" if new
182
188
[ok] Sender domain "send.example.com" is verified # when already verified
183
189
[ok] Segment "General" found (seg_xxxxx) # or "[ok] N segments found" if multiple
184
190
[ok] Pages secret RESEND_API_KEY set for project "<project>" # when CLOUDFLARE_API_TOKEN is available
@@ -196,26 +202,31 @@ If no sender domain exists yet, the command registers it with Resend automatical
196
202
197
203
If Cloudflare auth is missing or the Pages secret update fails, the command falls back to printing the manual `wrangler pages secret put` command.
198
204
199
-
### 8. Write the first issue
205
+
### 9. Write the first issue
200
206
201
207
If you ran `init`, a sample `your-first-newsletter-issue.md` already exists as a draft. Edit it or create a new Markdown file in the newsletter directory:
202
208
203
209
```markdown
204
210
---
205
211
issue: 1
206
212
status: ready
213
+
title: Welcome to My Newsletter
214
+
date: 2025-01-15
207
215
---
208
216
209
217
# Welcome to My Newsletter
210
218
211
219
This is the first issue.
212
220
```
213
221
214
-
The `status` field controls visibility:
215
-
-`ready` -- included in `build` and `deploy`
216
-
-`draft` -- excluded from `build`, but included in `preview` (unless `--no-drafts` is passed)
222
+
Frontmatter fields:
223
+
224
+
-`issue` (required) -- positive integer, must be unique across all issues
225
+
-`status` (required) -- `ready` (included in build/deploy) or `draft` (excluded from build, included in preview)
226
+
-`title` (optional) -- overrides the first `#` heading in the body
227
+
-`date` (optional) -- publication date in YYYY-MM-DD format
| "Cloudflare API token is invalid" | Regenerate at dash.cloudflare.com/profile/api-tokens |
242
-
| 403 Unauthorized on `setup web`| Token needs Account > Cloudflare Pages > Edit. If `web_hosting.domain` is set, also add Zone > DNS > Edit for that specific zone. |
243
-
| "API token lacks required permissions" | Token needs Account > Cloudflare Pages > Edit. If `web_hosting.domain` is set, also add Zone > DNS > Edit for that specific zone. |
244
-
| "Pages project name X is not available" | Change `web_hosting.project` in laughing-man.yaml |
245
-
| "A DNS record managed by Workers already exists" | Another Workers/Pages project owns a record on that host. Managed records can't be deleted from the DNS page directly. Delete the Worker or Pages project that owns the record under Workers & Pages in the dashboard, or use a different domain/subdomain. |
246
-
| Custom domain shows 522 error | Wait for DNS propagation (up to 48h), verify CNAME is correct |
247
-
| "Resend API key is invalid" | Regenerate at resend.com/api-keys. Must have "Full access" permission. |
248
-
|`setup newsletter` shows "not yet verified" | Add the DNS records printed by the command, wait a few minutes, re-run. |
249
-
| Subscribe form returns "Failed to subscribe" | Resend secret not set on Pages project. Re-run `setup newsletter` with a valid `CLOUDFLARE_API_TOKEN`, or run `bunx wrangler pages secret put RESEND_API_KEY --project-name <project>`. Verify with `bunx wrangler pages secret list --project-name <project>`. |
250
-
| Subscribe form returns "Invalid request" | Request body is not valid JSON or missing `email` field. Check browser console for errors. |
| "Cloudflare API token is invalid" | Regenerate at dash.cloudflare.com/profile/api-tokens|
253
+
| 403 Unauthorized on `setup web`| Token needs Account > Cloudflare Pages > Edit. If `web_hosting.domain` is set, also add Zone > DNS > Edit for that specific zone.|
254
+
| "API token lacks required permissions" | Token needs Account > Cloudflare Pages > Edit. If `web_hosting.domain` is set, also add Zone > DNS > Edit for that specific zone.|
255
+
| "Pages project name X is not available" | Change `web_hosting.project` in laughing-man.yaml|
256
+
| "A DNS record managed by Workers already exists" | Another Workers/Pages project owns a record on that host. Managed records can't be deleted from the DNS page directly. Delete the Worker or Pages project that owns the record under Workers & Pages in the dashboard, or use a different domain/subdomain. |
257
+
| Custom domain shows 522 error | Wait for DNS propagation (up to 48h), verify CNAME is correct|
258
+
| "Resend API key is invalid" | Regenerate at resend.com/api-keys. Must have "Full access" permission.|
259
+
|`setup newsletter` shows "not yet verified" | Add the DNS records printed by the command, wait a few minutes, re-run.|
260
+
| Subscribe form returns "Failed to subscribe" | Resend secret not set on Pages project. Re-run `setup newsletter` with a valid `CLOUDFLARE_API_TOKEN`, or run `bunx wrangler pages secret put RESEND_API_KEY --project-name <project>`. Verify with `bunx wrangler pages secret list --project-name <project>`. |
261
+
| Subscribe form returns "Invalid request" | Request body is not valid JSON or missing `email` field. Check browser console for errors.|
0 commit comments