-
Notifications
You must be signed in to change notification settings - Fork 0
Content API
pH7x Systems edited this page Jul 21, 2026
·
5 revisions
Sardine can publish the site's content as static, versioned JSON alongside the HTML. There is no server component and no authentication: the files are part of the build output and are served by whatever hosts the site.
[build]
content_api = trueEvery build then also writes the API files under api/v1/.
| Path | Contents |
|---|---|
/api/v1/site.json |
Site metadata: name, base URL, blog path, languages, categories |
/api/v1/<lang>/content.json |
All published articles and pages for one language |
Every file carries version — the API version it speaks.
-
site.json—name,base_url,blog_path,languages(codes, source language first) andcategories(slug → per-language labels). -
<lang>/content.json—languageplusarticles(id, per-language slug and URL, title, summary, safe renderedbody_html, ISO 8601 date, author, featured flag, category, tags, cover metadata includingfocalwhen an editor set one,sources({type, srcset} modern-format alternatives, possibly empty) andsrcsetwhen image derivatives are configured, custom fields) andpages(id, slug, URL, title, description, sections with key, kind, resolved fields and images).
Articles and pages additionally carry seo when an editor set per-entry overrides (seo_title, seo_description, noindex, canonical, og_image) — absent otherwise.
- Only published content: the API lists exactly what the built site publishes — no drafts, trashed entries or entries outside their publication window; a language file only lists entries whose translation is complete.
-
Stable within a version: fields may be added within
v1; renames or removals only ever happen under a new/api/vN/path, so a consumer pinned to/api/v1/keeps working. - Static and cacheable: plain UTF-8 JSON files on the same host as the site — cache and CDN them like any other static asset.
Live example: https://sardine.ph7x.com/api/v1/site.json.
Sardine CMS — multilingual, static-first CMS framework · Repository · Live demo · Apache-2.0