Skip to content

Content API

pH7x Systems edited this page Jul 20, 2026 · 1 revision

Content API

Opt-in headless output (M6): content_api = true under [build] makes every build also emit versioned JSON under api/v1/, next to the HTML — static files on the same host, no server component.

  • api/v1/site.jsonversion, name, base_url, blog_path, languages, categories (slug → per-language labels).
  • api/v1/<lang>/content.json — one per configured language: articles (id, per-language slug and URL, title, summary, rendered body_html, date, author, featured flag, category, tags, cover metadata incl. srcset, custom fields) and pages (id, slug, URL, title, description, typed sections with fields and images).

Guarantees: exactly the HTML build's publication, scheduling, trash and language-parity gates; deterministic output (sorted keys, no build timestamps); versioned envelope — additive fields may join within a version, breaking changes move to a new api/vN/ path. The repository's tests/test_content_api.py is the public contract.

Live example: https://sardine.ph7x.com/api/v1/site.json.

Clone this wiki locally