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
Publish PT at / and EN at /en, link posts via translationKey, and deploy to Cloudflare Workers on push to main.
Co-authored-by: Cursor <cursoragent@cursor.com>
Cada post MDX declara `lang` (`pt` | `en`) e `translationKey` para ligar as versões. A UI e as datas seguem o idioma da rota. O poema da sidebar permanece em português.
14
+
5
15
## Desenvolvimento
6
16
7
17
```sh
@@ -18,29 +28,62 @@ npm run build
18
28
npm run preview:cf # wrangler dev com o build estático
19
29
```
20
30
21
-
Use `npm run dev` no dia a dia.
31
+
## Conteúdo
22
32
23
-
## Deploy
33
+
Posts ficam em `src/content/blog/` como arquivos MDX.
24
34
25
-
```sh
26
-
npm run deploy
35
+
Frontmatter mínimo de um post publicado:
36
+
37
+
```yaml
38
+
title: Meu título
39
+
date: '2026-08-02'
40
+
lang: pt
41
+
translationKey: meu-titulo
42
+
draft: false
27
43
```
28
44
29
-
Requer [Wrangler](https://developers.cloudflare.com/workers/wrangler/) autenticado (`wrangler login`). O Worker já está ligado a `blog.lucis.dev`.
45
+
A tradução em inglês usa o mesmo `translationKey`, `lang: en` e um slug/arquivo próprio (ex.: `my-title.mdx` → `/en/blog/my-title`).
30
46
31
-
## Conteúdo
47
+
Posts com `draft: true`, ou título contendo `Resumo:` / `Summary:`, não aparecem na home nem nas rotas públicas.
32
48
33
-
Posts ficam em `src/content/blog/` como arquivos MDX. Para reimportar do CMS Deco legado (JSONs em `scripts/legacy-posts/`):
49
+
Para reimportar do CMS Deco legado (JSONs em `scripts/legacy-posts/`):
34
50
35
51
```sh
36
52
npm run migrate
37
53
```
38
54
39
-
Posts com `draft: true` ou título contendo "Resumo:" não aparecem na home.
55
+
## Deploy
56
+
57
+
### Automático (GitHub Actions)
58
+
59
+
Todo push em `main` (e disparos manuais via *Actions → Deploy → Run workflow*) faz build e publica no Worker `lucispersonalblog`, ligado a `blog.lucis.dev`.
Secrets necessários no repositório (`Settings → Secrets and variables → Actions`):
64
+
65
+
| Secret | Valor |
66
+
|--------|--------|
67
+
| `CLOUDFLARE_ACCOUNT_ID` | ID da conta Cloudflare |
68
+
| `CLOUDFLARE_API_TOKEN` | API Token com permissão **Edit Cloudflare Workers** |
69
+
70
+
Crie o token em [Account API tokens](https://dash.cloudflare.com/profile/api-tokens) com o template **Edit Cloudflare Workers**, escopado à conta do blog.
0 commit comments