create-jant 0.3.39 → 0.3.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/README.md +49 -62
  2. package/dist/index.js +19 -1
  3. package/package.json +4 -4
  4. package/template/.agents/skills/building-jant-site/SKILL.md +101 -0
  5. package/template/.agents/skills/jant-http-api/SKILL.md +195 -0
  6. package/template/.agents/skills/jant-site-ops/SKILL.md +88 -0
  7. package/template/AGENTS.md +65 -0
  8. package/template/README.md +86 -159
  9. package/template/_github/workflows/deploy.yml +34 -0
  10. package/template/examples/agent-content-automation/README.md +92 -0
  11. package/template/examples/agent-content-automation/note.json +7 -0
  12. package/template/examples/agent-content-automation/quote.json +9 -0
  13. package/template/examples/agent-content-automation/site-settings.json +5 -0
  14. package/template/package.json +1 -1
  15. package/template/wrangler.toml +1 -1
  16. package/template/docs/internal/migrate.md +0 -10
  17. package/template/docs/internal/operations.md +0 -61
  18. package/template/static-site-export/README.md +0 -70
  19. package/template/static-site-export/config.toml +0 -16
  20. package/template/static-site-export/content/41q27/index.md +0 -29
  21. package/template/static-site-export/content/_index.md +0 -4
  22. package/template/static-site-export/content/a-night-heron-field-guide-for-my-walk-folder/index.md +0 -16
  23. package/template/static-site-export/content/a-quiet-saturday-after-a-busy-week/index.md +0 -23
  24. package/template/static-site-export/content/are-na-is-the-only-bookmark-pile-i-still-revisit/index.md +0 -16
  25. package/template/static-site-export/content/bought-too-many-lemons-again/index.md +0 -15
  26. package/template/static-site-export/content/current-tea-rotation/index.md +0 -20
  27. package/template/static-site-export/content/derek-sivers-still-writes-the-kind-of-internet-i-want-more-of/index.md +0 -16
  28. package/template/static-site-export/content/desk-but-better/index.md +0 -16
  29. package/template/static-site-export/content/e0kcg/index.md +0 -12
  30. package/template/static-site-export/content/from-basho/index.md +0 -15
  31. package/template/static-site-export/content/from-epictetus/index.md +0 -15
  32. package/template/static-site-export/content/from-marcus-aurelius/index.md +0 -15
  33. package/template/static-site-export/content/from-seneca/index.md +0 -15
  34. package/template/static-site-export/content/from-thoreau/index.md +0 -15
  35. package/template/static-site-export/content/gkbvv/index.md +0 -28
  36. package/template/static-site-export/content/k5vh8/index.md +0 -29
  37. package/template/static-site-export/content/mynoise-for-rainy-afternoons/index.md +0 -16
  38. package/template/static-site-export/content/nts-archives-are-good-cleaning-music/index.md +0 -16
  39. package/template/static-site-export/content/qgfcu/index.md +0 -29
  40. package/template/static-site-export/content/rain-makes-my-neighborhood-look-better/index.md +0 -17
  41. package/template/static-site-export/content/serious-eats-on-tomato-and-egg-soup/index.md +0 -16
  42. package/template/static-site-export/content/te812/index.md +0 -29
  43. package/template/static-site-export/content/telk3/index.md +0 -29
  44. package/template/static-site-export/content/the-five-minute-reset-is-still-the-best-habit-i-have/index.md +0 -21
  45. package/template/static-site-export/content/the-hallway-light-took-12-minutes-and-3-months/index.md +0 -18
  46. package/template/static-site-export/content/the-recurse-center-manual-is-weirdly-calming/index.md +0 -16
  47. package/template/static-site-export/content/u08bn/index.md +0 -29
  48. package/template/static-site-export/content/what-i-actually-use-my-notebook-for/index.md +0 -23
  49. package/template/static-site-export/content/z4s9v/index.md +0 -29
  50. package/template/static-site-export/static/style.css +0 -338
  51. package/template/static-site-export/templates/base.html +0 -23
  52. package/template/static-site-export/templates/index.html +0 -20
  53. package/template/static-site-export/templates/macros.html +0 -58
  54. package/template/static-site-export/templates/page.html +0 -8
  55. package/template/static-site-export/templates/section.html +0 -17
  56. package/template/static-site-export/templates/taxonomy_list.html +0 -15
  57. package/template/static-site-export/templates/taxonomy_single.html +0 -13
@@ -2,239 +2,166 @@
2
2
 
3
3
  A personal website/blog powered by [Jant](https://github.com/jant-me/jant).
4
4
 
5
- ## Option A: One-Click Deploy
5
+ Examples below use `npm`, but the same scripts work with `pnpm run` or `yarn`.
6
6
 
7
- Deploy to Cloudflare instantly — no local setup required:
7
+ ## Option A: One-Click Deploy
8
8
 
9
9
  [![Deploy to Cloudflare](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/jant-me/jant-starter)
10
10
 
11
+ Deploy to Cloudflare instantly, without local setup.
12
+
13
+ In this flow, Cloudflare creates the new GitHub repo, D1 database, and R2 bucket for you from the form.
14
+
11
15
  ### Deploy form fields
12
16
 
13
- | Field | What to do |
14
- | -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
15
- | **Git account** | Select your GitHub account. A new repo will be created for you. |
16
- | **D1 database** | Keep "Create new". The default name is fine. |
17
- | **Database location hint** | Pick a region close to you (optional, Cloudflare auto-selects). |
18
- | **R2 bucket** | Keep "Create new". The default name is fine. Used for media uploads. |
19
- | **AUTH_SECRET** | Used for login session encryption. Keep the pre-filled value or generate your own with `openssl rand -base64 32`. |
20
- | **SITE_ORIGIN** | Optional. Set this when you want a fixed public origin such as `https://my-blog.example.com`. If you leave it empty, Jant uses the current request origin. |
21
- | **SITE_PATH_PREFIX** | Optional. Set this only when you mount the site under a subpath such as `/blog`. Leave it empty for normal root deploys. |
17
+ | Field | What to do |
18
+ | -------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
19
+ | **Git account** | Select your GitHub account. Cloudflare creates a new repo for you. |
20
+ | **D1 database** | Keep **Create new**. The default name is fine. |
21
+ | **Database location hint** | Pick a nearby region if you want. Leaving it alone is fine too. |
22
+ | **R2 bucket** | Keep **Create new**. The default name is fine. |
23
+ | **AUTH_SECRET** | Keep the generated value, or replace it with your own 32+ character secret. |
24
+ | **SITE_ORIGIN** | Optional. Set this when you want a fixed public origin such as `https://my-blog.example.com`. |
25
+ | **SITE_PATH_PREFIX** | Optional. Set this only when you mount the site under a subpath such as `/blog`. Leave it empty for a normal root deploy. |
22
26
 
23
27
  ### After deploy
24
28
 
25
- 1. Visit your site at the URL shown in the Cloudflare dashboard (e.g. `https://<project>.<account>.workers.dev`)
26
- 2. Go to `/setup` to set up your admin account
27
- 3. If you set `SITE_ORIGIN` to a custom domain, add it in: Cloudflare dashboard Workers & Pages → your worker → Settings → Domains & Routes → Add Custom Domain
28
- 4. If you leave `SITE_ORIGIN` empty, Jant uses your current `*.workers.dev` or custom-domain request host automatically
29
+ 1. Open the site URL shown in Cloudflare, usually `https://<project>.<account>.workers.dev`
30
+ 2. Go through the setup flow and create your admin account
31
+ 3. If you set `SITE_ORIGIN` to a custom domain, add that domain in Cloudflare under **Workers & Pages**
32
+ 4. If you leave `SITE_ORIGIN` empty, Jant uses the current request host automatically
29
33
 
30
34
  ### Develop locally
31
35
 
36
+ Cloudflare creates a GitHub repo for you during one-click deploy. To keep working locally:
37
+
32
38
  ```bash
33
- # Clone the repo that was created for you
34
39
  git clone git@github.com:<your-username>/<your-repo>.git
35
40
  cd <your-repo>
36
41
  npm install
37
42
  npm run dev
38
43
  ```
39
44
 
40
- Visit http://localhost:3000. Changes pushed to `main` will auto-deploy.
45
+ Open `http://localhost:3000`. Changes pushed to `main` will auto-deploy.
41
46
 
42
- ## Option B: Create with CLI
43
-
44
- Set up a new project locally, then deploy manually:
47
+ Need another local port? Run:
45
48
 
46
49
  ```bash
47
- npm create jant my-site
48
- cd my-site
49
- npm run dev
50
+ PORT=3030 npm run dev
50
51
  ```
51
52
 
52
- Visit http://localhost:3000. When you're ready to go live, continue with [Deploy to Cloudflare](#deploy-to-cloudflare) below.
53
-
54
- Need another local port? Run `PORT=3030 npm run dev`.
53
+ ## Option B: Manual Deploy from Your Machine
55
54
 
56
- ### Deploy to Cloudflare
55
+ If you would rather create or keep a local site repo and deploy it yourself, use the steps below.
57
56
 
58
- #### 1. Prerequisites
59
-
60
- Install [Wrangler CLI](https://developers.cloudflare.com/workers/wrangler/install-and-update/) and log in:
57
+ ### 1. Log In to Wrangler
61
58
 
62
59
  ```bash
63
- wrangler login
60
+ npx wrangler login
64
61
  ```
65
62
 
66
- #### 2. Create D1 Database
67
-
68
- Check the `database_name` in your `wrangler.toml` (defaults to `<your-project>-db`), then create it:
63
+ ### 2. Create the D1 Database
69
64
 
70
65
  ```bash
71
- wrangler d1 create <your-project>-db
72
- # Copy the database_id from the output!
66
+ npx wrangler d1 create <your-project>-db
73
67
  ```
74
68
 
75
- #### 3. Update Configuration
69
+ Copy the `database_id` from the output into `wrangler.toml`.
76
70
 
77
- Edit `wrangler.toml`:
71
+ ### 3. Create the R2 Bucket
78
72
 
79
- - Replace `database_id = "local"` with the ID from step 2
80
- - Set `SITE_ORIGIN` if you want a fixed public origin (e.g. `https://example.com`)
81
- - Set `SITE_PATH_PREFIX` only if you deploy under a subpath (e.g. `/blog`)
82
-
83
- > R2 bucket is automatically created on first deploy — no manual setup needed.
84
- >
85
- > **Note:** Changing `database_id` resets your local development database (local data is stored per database ID). If you've already started local development, you'll need to go through the setup wizard again to create your admin account.
86
- >
87
- > **Subpath deploys on Cloudflare:** If `SITE_PATH_PREFIX` is set to `/blog`, Jant publishes built assets under `/blog/_assets/*`. `npm run deploy` detects that prefix and prepares `dist/public/blog/_assets/*` automatically, so routing `/blog*` to the same Worker is enough.
73
+ ```bash
74
+ npx wrangler r2 bucket create <your-project>-media
75
+ ```
88
76
 
89
- #### 4. Set Production Secrets
77
+ Make sure `wrangler.toml` uses the same bucket name.
90
78
 
91
- Generate a production secret and save it somewhere safe (you'll need it again for CI):
79
+ ### 4. Set the Production Auth Secret
92
80
 
93
81
  ```bash
94
- # Generate a secret
95
82
  openssl rand -base64 32
96
-
97
- # Set it in Cloudflare
98
- wrangler secret put AUTH_SECRET
99
- # Paste the generated value when prompted
83
+ npx wrangler secret put AUTH_SECRET
100
84
  ```
101
85
 
102
- > **Important:** This is separate from the `AUTH_SECRET` in `.dev.vars` (which is for local development only). Do not change the production secret after your site is live — it will invalidate all sessions. If you get locked out, use `npm run reset-password` to generate a password reset link.
86
+ This is separate from the local secret in `.dev.vars`.
103
87
 
104
- #### 5. Deploy
88
+ ### 5. Deploy
105
89
 
106
90
  ```bash
107
- # Apply database migrations and deploy
108
91
  npm run deploy
109
92
  ```
110
93
 
111
- Your site is now live at `https://<your-project>.<your-subdomain>.workers.dev`!
112
-
113
- #### 6. Custom Domain (Optional)
94
+ After deploy, Cloudflare gives you a `*.workers.dev` URL.
114
95
 
115
- 1. Go to [Cloudflare Dashboard](https://dash.cloudflare.com) → Workers & Pages
116
- 2. Select your worker → Settings → Domains & Routes
117
- 3. Click **Add -> Custom domain** and enter your domain
96
+ ## Local Development
118
97
 
119
- ### GitHub Actions (CI/CD)
120
-
121
- A workflow file is included at `.github/workflows/deploy.yml`. Complete the [deployment](#deploy-to-cloudflare) first, then set up CI for automatic deployments.
122
-
123
- > Runtime secrets (`AUTH_SECRET`, S3 keys, etc.) are already stored in Cloudflare from the manual deployment step. CI only needs deployment credentials.
124
-
125
- #### 1. Push to GitHub
126
-
127
- Create a new repository on [GitHub](https://github.com/new), then commit and push your project:
98
+ Start the local dev server:
128
99
 
129
100
  ```bash
130
- git add -A
131
- git commit -m "Initial setup"
132
- git remote add origin git@github.com:<your-username>/<your-repo>.git
133
- git push -u origin main
101
+ npm run dev
134
102
  ```
135
103
 
136
- #### 2. Create API Token
104
+ Open `http://localhost:3000`.
137
105
 
138
- 1. Go to [Cloudflare API Tokens](https://dash.cloudflare.com/profile/api-tokens)
139
- 2. Click **Create Token** → **Use template** next to **Edit Cloudflare Workers**
140
- 3. **Add D1 permission** (not in template by default):
141
- - Click **+ Add more** → **Account** → **D1** → **Edit**
106
+ ## Common Commands
142
107
 
143
- Your permissions should include:
108
+ | Command | Description |
109
+ | ------------------------------------------------------ | ------------------------------------- |
110
+ | `npm run dev` | Start local development |
111
+ | `npm run deploy` | Apply remote migrations and deploy |
112
+ | `npm run reset-password` | Generate a password reset token |
113
+ | `npx jant site export --output ./jant-site-export.zip` | Export the site as a portable archive |
144
114
 
145
- | Scope | Permission | Access |
146
- | ------- | ------------------ | ----------------------------- |
147
- | Account | Workers Scripts | Edit |
148
- | Account | Workers R2 Storage | Edit |
149
- | Account | **D1** | **Edit** ← Must add manually! |
150
- | Zone | Workers Routes | Edit |
115
+ ## Configuration
151
116
 
152
- 4. Set **Account Resources** **Include** your account
153
- 5. Set **Zone Resources** → **Include** → **All zones from an account** → your account
154
- 6. **Create Token** and copy it
117
+ The most common values live in two files:
155
118
 
156
- #### 3. Add GitHub Secrets
119
+ - `.dev.vars` for local secrets
120
+ - `wrangler.toml` for non-sensitive Cloudflare configuration
157
121
 
158
- Go to your repo → **Settings** → **Secrets and variables** → **Actions**:
122
+ Useful examples:
159
123
 
160
- | Secret Name | Value |
161
- | --------------- | ------------------------------------------------------------------------ |
162
- | `CF_API_TOKEN` | API token from above |
163
- | `CF_ACCOUNT_ID` | Your Cloudflare Account ID (found in dashboard URL or `wrangler whoami`) |
164
-
165
- #### 4. Verify Auto-Deploy
166
-
167
- The workflow is pre-configured to deploy on every push to `main`. After pushing your code, check the **Actions** tab in your GitHub repo to confirm the deployment succeeded.
168
-
169
- ## Commands
170
-
171
- | Command | Description |
172
- | ------------------------ | ------------------------------------------------ |
173
- | `npm run dev` | Start local dev server (auto-applies migrations) |
174
- | `npm run deploy` | Apply remote migrations and deploy |
175
- | `npm run reset-password` | Generate a password reset link if locked out |
176
- | `npm run export` | Export D1 database to a SQL file |
177
-
178
- > Use `--remote` to run commands against your production database (e.g. `npx jant reset-password --remote`).
179
-
180
- ## Environment Variables
181
-
182
- | Variable | Description | Location |
183
- | ------------------ | ---------------------------------------------- | ---------------- |
184
- | `AUTH_SECRET` | Secret key for authentication (32+ chars) | `.dev.vars` file |
185
- | `SITE_ORIGIN` | Optional fixed public origin for absolute URLs | `wrangler.toml` |
186
- | `SITE_PATH_PREFIX` | Optional public path prefix such as `/blog` | `wrangler.toml` |
187
-
188
- For all available variables (site name, language, R2 storage, image optimization, S3, demo mode, etc.), see the **[Configuration Guide](https://github.com/jant-me/jant/blob/main/docs/configuration.md)**.
189
-
190
- ## Customization
191
-
192
- ### Color Themes
124
+ ```toml
125
+ [vars]
126
+ SITE_ORIGIN = "https://yourdomain.com"
127
+ # SITE_PATH_PREFIX = "/blog"
128
+ # R2_PUBLIC_URL = "https://media.yourdomain.com"
129
+ # IMAGE_TRANSFORM_URL = "https://media.yourdomain.com/cdn-cgi/image"
130
+ ```
193
131
 
194
- Pick a color theme from the dashboard: **Settings > Appearance**.
132
+ ## Documentation
195
133
 
196
- ### Custom CSS
134
+ Start here:
197
135
 
198
- Inject custom CSS from the dashboard: **Settings > Appearance > Custom CSS**. This CSS is applied with the highest priority, so you can override any built-in styles.
136
+ - [Introduction](https://github.com/jant-me/jant/blob/main/docs/overview.md)
137
+ - [Deploy on Cloudflare](https://github.com/jant-me/jant/blob/main/docs/deployment.md)
138
+ - [Configuration](https://github.com/jant-me/jant/blob/main/docs/configuration.md)
199
139
 
200
- ### Data Attributes
140
+ For writing and customization:
201
141
 
202
- Target specific elements with stable data attributes:
142
+ - [Writing and Organizing Posts](https://github.com/jant-me/jant/blob/main/docs/writing-and-organizing.md)
143
+ - [Theming](https://github.com/jant-me/jant/blob/main/docs/theming.md)
203
144
 
204
- ```css
205
- /* Style only note-format posts */
206
- [data-format="note"] {
207
- border-left: 3px solid var(--primary);
208
- }
145
+ For operations:
209
146
 
210
- /* Style the home page differently */
211
- [data-page="home"] {
212
- background: var(--muted);
213
- }
147
+ - [Export and Import](https://github.com/jant-me/jant/blob/main/docs/export-and-import.md)
148
+ - [Backups and Recovery](https://github.com/jant-me/jant/blob/main/docs/backups.md)
214
149
 
215
- /* Hide compose prompt for unauthenticated visitors */
216
- body:not([data-authenticated]) .compose-prompt {
217
- display: none;
218
- }
219
- ```
150
+ Reference:
220
151
 
221
- ## Updating
152
+ - [API Reference](https://github.com/jant-me/jant/blob/main/docs/API.md)
153
+ - [GitHub Repository](https://github.com/jant-me/jant)
222
154
 
223
- ```bash
224
- # Update @jant/core to latest version
225
- npm install @jant/core@latest
155
+ ## AI Coding Tools
226
156
 
227
- # Start dev server (auto-applies migrations locally)
228
- npm run dev
157
+ This site template includes project guidance in `AGENTS.md` plus task-focused skills in `.agents/skills/`.
229
158
 
230
- # Deploy (includes remote migrations)
231
- npm run deploy
232
- ```
159
+ For concrete content automation examples, see `examples/agent-content-automation/README.md`.
233
160
 
234
- > New versions of `@jant/core` may include database migrations. Check the [release notes](https://github.com/jant-me/jant/releases) for any breaking changes.
161
+ Available skills:
235
162
 
236
- ## Documentation
163
+ - `building-jant-site`
164
+ - `jant-http-api`
165
+ - `jant-site-ops`
237
166
 
238
- - [Configuration Guide](https://github.com/jant-me/jant/blob/main/docs/configuration.md)
239
- - [Theming Guide](https://github.com/jant-me/jant/blob/main/docs/theming.md)
240
- - [GitHub Repository](https://github.com/jant-me/jant)
167
+ If your coding tool expects Claude-style project files, `CLAUDE.md` and `.claude/skills/` are generated too.
@@ -34,13 +34,47 @@ jobs:
34
34
  - name: Install dependencies
35
35
  run: npm ci
36
36
 
37
+ - name: Check deploy prerequisites
38
+ id: preflight
39
+ env:
40
+ CF_API_TOKEN: ${{ secrets.CF_API_TOKEN }}
41
+ CF_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }}
42
+ run: |
43
+ set -eu
44
+
45
+ if [ -z "${CF_API_TOKEN}" ] || [ -z "${CF_ACCOUNT_ID}" ]; then
46
+ echo "ready=false" >> "$GITHUB_OUTPUT"
47
+ {
48
+ echo "### Deploy skipped"
49
+ echo
50
+ echo "Add \`CF_API_TOKEN\` and \`CF_ACCOUNT_ID\` in GitHub Actions secrets to enable auto-deploy."
51
+ } >> "$GITHUB_STEP_SUMMARY"
52
+ exit 0
53
+ fi
54
+
55
+ database_id="$(sed -n 's/^database_id = "\\([^"]*\\)".*/\\1/p' wrangler.toml | head -n 1)"
56
+
57
+ if [ -z "${database_id}" ] || [ "${database_id}" = "local" ]; then
58
+ echo "ready=false" >> "$GITHUB_OUTPUT"
59
+ {
60
+ echo "### Deploy skipped"
61
+ echo
62
+ echo "Replace the placeholder D1 \`database_id\` in \`wrangler.toml\` before enabling auto-deploy."
63
+ } >> "$GITHUB_STEP_SUMMARY"
64
+ exit 0
65
+ fi
66
+
67
+ echo "ready=true" >> "$GITHUB_OUTPUT"
68
+
37
69
  - name: Run migrations
70
+ if: steps.preflight.outputs.ready == 'true'
38
71
  run: npx wrangler d1 migrations apply DB --remote
39
72
  env:
40
73
  CLOUDFLARE_API_TOKEN: ${{ secrets.CF_API_TOKEN }}
41
74
  CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }}
42
75
 
43
76
  - name: Deploy to Cloudflare Workers
77
+ if: steps.preflight.outputs.ready == 'true'
44
78
  uses: cloudflare/wrangler-action@v3
45
79
  with:
46
80
  apiToken: ${{ secrets.CF_API_TOKEN }}
@@ -0,0 +1,92 @@
1
+ # Agent Content Automation
2
+
3
+ This folder shows the shortest path for content automation in a generated Jant site.
4
+
5
+ Prefer the local CLI when the agent is already on the site machine. Use MCP only when the caller already speaks MCP.
6
+
7
+ ## Publish a note from JSON
8
+
9
+ ```bash
10
+ npx jant posts create --input ./examples/agent-content-automation/note.json
11
+ ```
12
+
13
+ ## Publish a quote from JSON
14
+
15
+ ```bash
16
+ npx jant posts create --input ./examples/agent-content-automation/quote.json
17
+ ```
18
+
19
+ ## Update site settings from JSON
20
+
21
+ ```bash
22
+ npx jant settings update --input ./examples/agent-content-automation/site-settings.json
23
+ ```
24
+
25
+ ## Upload an image, then attach it to a post
26
+
27
+ Upload the file:
28
+
29
+ ```bash
30
+ npx jant media upload ./path/to/photo.webp --alt "Cover image"
31
+ ```
32
+
33
+ That returns a `med_*` ID. Use it in a post payload:
34
+
35
+ ```json
36
+ {
37
+ "format": "note",
38
+ "title": "A post with media",
39
+ "bodyMarkdown": "Uploaded through the local CLI.",
40
+ "status": "published",
41
+ "visibility": "public",
42
+ "attachments": [{ "type": "media", "mediaId": "med_..." }]
43
+ }
44
+ ```
45
+
46
+ Then publish it:
47
+
48
+ ```bash
49
+ npx jant posts create --json '{"format":"note","title":"A post with media","bodyMarkdown":"Uploaded through the local CLI.","status":"published","visibility":"public","attachments":[{"type":"media","mediaId":"med_..."}]}'
50
+ ```
51
+
52
+ ## Inline text attachments stay in the post payload
53
+
54
+ File uploads create reusable media records. Inline reading notes and markdown snippets stay inside the post payload itself:
55
+
56
+ ```json
57
+ {
58
+ "format": "note",
59
+ "bodyMarkdown": "A note with an attached markdown excerpt.",
60
+ "status": "published",
61
+ "visibility": "public",
62
+ "attachments": [
63
+ {
64
+ "type": "text",
65
+ "contentFormat": "markdown",
66
+ "content": "## Reading note\n\nKeep this attached to the post."
67
+ }
68
+ ]
69
+ }
70
+ ```
71
+
72
+ ## MCP example
73
+
74
+ Initialize:
75
+
76
+ ```bash
77
+ curl -X POST "$JANT_URL/api/mcp" \
78
+ -H "Authorization: Bearer $JANT_API_TOKEN" \
79
+ -H "Content-Type: application/json" \
80
+ -H "MCP-Protocol-Version: 2025-06-18" \
81
+ -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18"}}'
82
+ ```
83
+
84
+ Create a post through `tools/call`:
85
+
86
+ ```bash
87
+ curl -X POST "$JANT_URL/api/mcp" \
88
+ -H "Authorization: Bearer $JANT_API_TOKEN" \
89
+ -H "Content-Type: application/json" \
90
+ -H "MCP-Protocol-Version: 2025-06-18" \
91
+ -d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"jant_posts_create","arguments":{"format":"note","bodyMarkdown":"Created through MCP.","status":"published","visibility":"public"}}}'
92
+ ```
@@ -0,0 +1,7 @@
1
+ {
2
+ "format": "note",
3
+ "title": "A short note",
4
+ "bodyMarkdown": "Published through the local CLI example.",
5
+ "status": "published",
6
+ "visibility": "public"
7
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "format": "quote",
3
+ "quoteText": "What stands in the way becomes the way.",
4
+ "sourceName": "Marcus Aurelius",
5
+ "sourceUrl": "https://example.com/meditations",
6
+ "bodyMarkdown": "A source-backed quote published through the CLI example.",
7
+ "status": "published",
8
+ "visibility": "public"
9
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "SITE_NAME": "Example Jant Site",
3
+ "SITE_DESCRIPTION": "Automated through the local CLI example.",
4
+ "TIME_ZONE": "Asia/Shanghai"
5
+ }
@@ -12,6 +12,6 @@
12
12
  "@jant/core": "workspace:*"
13
13
  },
14
14
  "devDependencies": {
15
- "wrangler": "^4.76.0"
15
+ "wrangler": "catalog:"
16
16
  }
17
17
  }
@@ -24,7 +24,7 @@ port = 3000
24
24
  [vars]
25
25
  # Optional: Pin your site's public origin (e.g. https://my-blog.example.com)
26
26
  # https://github.com/jant-me/jant/blob/main/docs/configuration.md#public-urls-and-subpaths
27
- SITE_ORIGIN = "https://demo.jant.me" # @create-jant: "https://example.com"
27
+ SITE_ORIGIN = "https://demo.jant.me" # @create-jant: @remove
28
28
  # Optional: Mount the site under a subpath such as /blog
29
29
  # SITE_PATH_PREFIX = "/blog"
30
30
 
@@ -1,10 +0,0 @@
1
- # Demo Public Migration
2
-
3
- ```
4
- mise run demo-public-rebuild
5
- ```
6
-
7
- This is the canonical rebuild path for `demo.jant.me`. It imports the committed
8
- snapshot from `sites/demo-source/canonical/snapshot/`.
9
-
10
- See `sites/demo/docs/internal/operations.md` for the full public-demo workflow.
@@ -1,61 +0,0 @@
1
- # Demo Public Operations
2
-
3
- `sites/demo` is the public demo runtime at `demo.jant.me`.
4
-
5
- The daily operational commands still live in the root `mise.toml` because the
6
- workflow crosses both `sites/demo-source` and `sites/demo`, and `sites/demo`
7
- also doubles as the starter template source.
8
-
9
- ## Common Commands
10
-
11
- ```sh
12
- mise run demo-public-bootstrap
13
- mise run demo-public-rebuild
14
- mise run demo-public-verify
15
- mise run demo-public-clear-content
16
- mise run demo-public-clear-api-tokens
17
- ```
18
-
19
- ## Environment Files for Repo Tasks
20
-
21
- Repo-level demo tasks now auto-load:
22
-
23
- 1. `sites/demo/.env.local`
24
- 2. `sites/demo/.env`
25
- 3. repo root `.env.repo.local`
26
- 4. repo root `.env.repo`
27
- 5. legacy repo root `.env.local`
28
- 6. legacy repo root `.env`
29
-
30
- Shell environment variables still win over all of them.
31
-
32
- Recommended split:
33
-
34
- - repo root `.env.repo.local`: `CLOUDFLARE_API_TOKEN`, `CLOUDFLARE_ACCOUNT_ID`
35
- Start from [/.env.repo.example](/Users/green/project/jant/main/.env.repo.example).
36
- - [`sites/demo/.env.example`](/Users/green/project/jant/main/sites/demo/.env.example):
37
- copy to `.env.local` for `INTERNAL_ADMIN_TOKEN`, plus any local
38
- overrides such as `DEMO_PUBLIC_URL`, `DEMO_EMAIL`, or `DEMO_PASSWORD`
39
-
40
- ## Expected Flow
41
-
42
- 1. Curate content in `demo-source`.
43
- 2. Freeze it with `mise run demo-source-export-canonical`.
44
- 3. Review and commit `sites/demo-source/canonical/snapshot/`.
45
- 4. Publish it to `demo-public` with `mise run demo-public-rebuild`.
46
- 5. Let `.github/workflows/reset-demo.yml` re-run the same rebuild nightly.
47
-
48
- ## Notes
49
-
50
- - `demo-public-rebuild` is snapshot-based. It no longer imports the old static
51
- site export.
52
- - `demo-public-rebuild` keeps a standalone storage cleanup step before import.
53
- That cleanup exists so demo maintenance can enforce its own storage policy
54
- separately from the normal snapshot restore contract.
55
- - `demo-public-rebuild` also clears every user-created API token through
56
- `INTERNAL_ADMIN_TOKEN`, so demo tokens are disposable across nightly
57
- resets.
58
- - The rebuild workflow still imports the canonical snapshot with an explicit
59
- remap intent rather than relying on implicit single-site behavior.
60
- - `db-demo-reseed` remains as a compatibility alias for
61
- `mise run demo-public-rebuild`.
@@ -1,70 +0,0 @@
1
- # Jant Demo — Zola Export
2
-
3
- This is a static site exported from [Jant](https://github.com/jant-me/jant), ready to build with [Zola](https://www.getzola.org/).
4
-
5
- ## Install Zola
6
-
7
- **macOS (Homebrew):**
8
-
9
- ```sh
10
- brew install zola
11
- ```
12
-
13
- **Windows (Scoop):**
14
-
15
- ```sh
16
- scoop install zola
17
- ```
18
-
19
- **Linux (Snap):**
20
-
21
- ```sh
22
- snap install zola --edge
23
- ```
24
-
25
- Or download a binary from <https://github.com/getzola/zola/releases>.
26
-
27
- See the [Zola installation docs](https://www.getzola.org/documentation/getting-started/installation/) for more options.
28
-
29
- ## Quick start
30
-
31
- Preview locally:
32
-
33
- ```sh
34
- zola serve
35
- ```
36
-
37
- Then open <http://127.0.0.1:1111> in your browser.
38
-
39
- Build the site for deployment:
40
-
41
- ```sh
42
- zola build
43
- ```
44
-
45
- The output goes to the `public/` directory. Upload it to any static host (Netlify, Vercel, Cloudflare Pages, GitHub Pages, etc.).
46
-
47
- ## Project structure
48
-
49
- ```
50
- config.toml — Site configuration (title, URL, language)
51
- content/
52
- _index.md — Root section (homepage settings)
53
- {slug}/index.md — Individual posts (threads are merged into one page)
54
- templates/ — Tera templates (Zola's template engine)
55
- static/
56
- style.css — Stylesheet
57
- ```
58
-
59
- ## Customizing
60
-
61
- - **Site settings** — edit `config.toml` to change the title, URL, or language.
62
- - **Styles** — edit `static/style.css`. The theme supports light and dark modes via `prefers-color-scheme`.
63
- - **Templates** — edit files in `templates/`. Zola uses the [Tera](https://keats.github.io/tera/) template engine.
64
- - **Collections** — posts are tagged with collections via the `c` taxonomy. Browse them at `/c/`.
65
-
66
- ## Notes
67
-
68
- - Media files (images, etc.) are **not** included in the export. They link back to the original site.
69
- - Thread replies are merged into the root post as a single page. Reply metadata is preserved in HTML comments (`<!-- jant:reply ... -->`).
70
- - Posts with `draft: true` in front matter are only built when you pass the `--drafts` flag to `zola build` or `zola serve`.