@odla-ai/blog 0.0.1 → 0.0.2
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.
- package/README.md +8 -0
- package/llms.txt +28 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -37,6 +37,14 @@ Pick one with `"theme": "salt"` in `blog.config.json`. Override any theme file b
|
|
|
37
37
|
placing a same-named file in your site's `theme/` directory. Preview all four
|
|
38
38
|
against the example site with `npm run preview` (from the monorepo root).
|
|
39
39
|
|
|
40
|
+
## Deploy (Cloudflare)
|
|
41
|
+
|
|
42
|
+
`build()` emits a plain static directory; serve it from a Worker assets
|
|
43
|
+
binding — `{ "assets": { "directory": "./dist-site" } }` in `wrangler.jsonc`,
|
|
44
|
+
build before every deploy. Add a `main` worker script only when you want
|
|
45
|
+
`/api/*` routes next to the static site (see `examples/demo-app` in the
|
|
46
|
+
odla-ai monorepo for the full pattern, including odla-db + o11y wiring).
|
|
47
|
+
|
|
40
48
|
## Status
|
|
41
49
|
|
|
42
50
|
Early. The build pipeline, themes, and example site work; CLI (`init`/`new`/`dev`/
|
package/llms.txt
CHANGED
|
@@ -151,6 +151,34 @@ the whole stylesheet, put them in `theme/custom.css` — the build appends it
|
|
|
151
151
|
to the theme's CSS. Post URLs live under `config.postsPath` (default
|
|
152
152
|
"posts").
|
|
153
153
|
|
|
154
|
+
## Deploy (Cloudflare)
|
|
155
|
+
|
|
156
|
+
The output is a plain static directory — serve it from a Worker's assets
|
|
157
|
+
binding (this is what `blog init --deploy cloudflare` will generate; a
|
|
158
|
+
working example lives at `examples/demo-app` in the odla-ai monorepo):
|
|
159
|
+
|
|
160
|
+
```js
|
|
161
|
+
// build-site.mjs — run before every deploy
|
|
162
|
+
import { build } from "@odla-ai/blog";
|
|
163
|
+
await build({ siteDir: "site", outDir: "dist-site" });
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
```jsonc
|
|
167
|
+
// wrangler.jsonc
|
|
168
|
+
{
|
|
169
|
+
"name": "my-site",
|
|
170
|
+
"main": "src/worker.ts", // optional: only if you add /api routes
|
|
171
|
+
"compatibility_date": "2025-11-01",
|
|
172
|
+
"assets": { "directory": "./dist-site", "binding": "ASSETS", "not_found_handling": "404-page" }
|
|
173
|
+
}
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
A pure-static site needs no worker code at all (`main` optional; assets serve
|
|
177
|
+
directly). With a `main`, non-asset paths (e.g. `/api/*`) reach your fetch
|
|
178
|
+
handler and everything else serves the site — the pattern for pairing the
|
|
179
|
+
static layer with odla-db interactivity. Deploy: `wrangler deploy` after
|
|
180
|
+
building. Set `config.url` to the final origin for correct canonical/RSS URLs.
|
|
181
|
+
|
|
154
182
|
## Gotchas
|
|
155
183
|
|
|
156
184
|
- `blog.config.json` is plain JSON — no comments, no trailing commas.
|
package/package.json
CHANGED