create-hozu 0.3.0 → 0.4.0
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/package.json +1 -1
- package/skill/reference.md +8 -1
package/package.json
CHANGED
package/skill/reference.md
CHANGED
|
@@ -112,8 +112,12 @@ There are no rewrites: one URL has one owner.
|
|
|
112
112
|
dimensions). With `@hozu/image` installed, pass `images: await optimizeImages(build)` to `createServer` (and
|
|
113
113
|
`hozu build` does it itself): raster assets get WebP `srcset` widths and `sizes`.
|
|
114
114
|
- **Share images:** `head.render` → `image: ui.og({ title, subtitle })` renders a 1200×630 card; pass
|
|
115
|
-
`og: ogImage` (from `@hozu/image`) to `createServer`.
|
|
115
|
+
`og: ogImage` (from `@hozu/image`) to `createServer`. On a static host, use a file instead:
|
|
116
|
+
`image: ui.asset(new URL('./share.png', import.meta.url))` (made absolute with `site.url`).
|
|
116
117
|
- **Fonts:** a local `@font-face` gets a size-matched `"<Family> Fallback"` automatically.
|
|
118
|
+
- **Page transitions:** the stylesheet turns on cross-document view transitions, so links between pages cross-fade
|
|
119
|
+
instead of flashing (no JS). Turn them off with `@view-transition { navigation: none; }` in `app.css`; style them
|
|
120
|
+
with `::view-transition-*`.
|
|
117
121
|
|
|
118
122
|
## Preview (drafts)
|
|
119
123
|
`createServer({ preview: { secret } })`; `GET /_hozu/preview?secret=…&path=/posts/a` turns preview on (a signed
|
|
@@ -136,6 +140,9 @@ Cloudflare Workers or Vercel the server is `createHandler({ build, manifest, res
|
|
|
136
140
|
`@hozu/runtime-server` with `export default { fetch: handler.fetch }`, where
|
|
137
141
|
`import * as render from './dist/server/render.js'` is the page code `hozu build` generates (edge runtimes cannot
|
|
138
142
|
generate it at startup). Page cache and tag revalidation are per instance.
|
|
143
|
+
A fully static site (GitHub Pages, any file host): `exportStatic({ build, styles, resolvers, outDir })` from
|
|
144
|
+
`@hozu/adapter-static` writes every page without per-request data, plus the files they link to, and lists skipped
|
|
145
|
+
routes.
|
|
139
146
|
```ts
|
|
140
147
|
import manifest from './dist/manifest.json' with { type: 'json' }
|
|
141
148
|
import * as render from './dist/server/render.js'
|