One line per field
field(), block() and entry() return the attributes to spread. Pure functions: server components and build time included.
For developers
Leiho doesn’t ask you to change framework, router or hosting. Spread field() where editors should click, read the content in one request, and get types for it.
import { field, block } from 'leiho';
export function Hero({ page, i }) {
return (
<section {...block(page, 'sections', i, 'Hero')}>
<h1 {...field(page, `sections.${i}.title`)}>{page.fields.sections[i].title}</h1>
</section>
);
}field(), block() and entry() return the attributes to spread. Pure functions: server components and build time included.
loadLeihoContent fetches the whole site once, with an ETag and a snapshot fallback.
npx leiho types writes TypeScript declarations for exactly the JSON you receive.
Keep leiho.schema.json in your repository and import it on staging and production.
The bridge loads only inside the editor, has no dependencies and makes no network request.
Adapters for other field plugins, deployment drivers, filters on the content API.
Your components stay the same. Add the attributes where editors should be able to click.
import { field, block } from 'leiho';
export function Hero({ page, i }) {
return (
<section {...block(page, 'sections', i, 'Hero')}>
<h1 {...field(page, `sections.${i}.title`)}>{page.fields.sections[i].title}</h1>
</section>
);
}The plugin and the bridge are GPL and live on GitHub. Read the code, open an issue, send a pull request.
Free and open source. Try it on a real WordPress, in your browser.