One request per build
The export returns every published item at once, instead of one request per page.
Content API
Leiho serves your content to the front end, already shaped for it. WordPress stays the single source of truth, and your repository holds code, not content.
import { loadLeihoContent, indexLeihoContent } from 'leiho/content';
const { data } = await loadLeihoContent({ url: 'https://cms.example.com' });
const content = indexLeihoContent(data);
const home = content.byPath('/');
home.fields.hero_title;The export returns every published item at once, instead of one request per page.
Responses carry an ETag. An unchanged build gets a 304 and downloads nothing.
npx leiho types writes TypeScript declarations of exactly the JSON you receive.
If WordPress doesn't answer, the build carries on with the last known content and says so.
Images come with url, alt, sizes; relations with their path; rich text already rendered.
Object cache, page caches and CDNs are used and purged when content changes.
One call in your build, then look pages up by path, type or slug.
import { loadLeihoContent, indexLeihoContent } from 'leiho/content';
const { data } = await loadLeihoContent({ url: 'https://cms.example.com' });
const content = indexLeihoContent(data);
const home = content.byPath('/');
home.fields.hero_title;GET /wp-json/leiho/v1/export returns everything. /content filters and paginates, /content/{id} returns one item (drafts for logged-in editors), /types returns the TypeScript declarations.
Published content is public by default. Switch the API to restricted and set LEIHO_TOKEN in your build environment.
Free and open source. Try it on a real WordPress, in your browser.