Skip to content

The ax block: what your project publishes to machines

Six machine-facing surfaces are configured in one block — llms.txt, llms-full.txt, sitemap, robots, JSON-LD and markdown — and only markdown is off by default.

One ax block configures six surfaces. It is resolved once, at config time, into a fully-explicit object — every sub-block present, every default filled in — so no serve-time generator ever re-decides what a missing value meant. Which also means the shortest useful ax block is the one that overrides nothing.

kywi.config.tsts
ax: {
  markdown: { enabled: true },
  // Absolute origin for sitemap/llms <loc> URLs. Wins outright over the
  // host-derived fallback (core 0.18.0), so cached AX bodies always carry the
  // canonical https origin regardless of which alias served the request.
  baseUrl: 'https://kywi-marketing-production.up.railway.app',
},

The block, surface by surface

Every ax surface is enabled unless you disable it, with one exception: markdown negotiation defaults to false, so a site that wants a .md twin of every page has to opt in. The other defaults — a 3600-second TTL, sitemap priority 0.5 and changefreq weekly, robots referencing both the sitemap and llms.txt — are the ones you are living with if you leave the block out.
NameTypeDefaultDescription
enabledbooleantrue

Master switch for all six surfaces.

baseUrlstringrequest origin, else https://{domain}

Absolute origin for every URL these surfaces emit. Set it when responses are cached and more than one host serves the site.

cacheTtlnumber (seconds)3600

TTL on the generated bodies.

llmsTxtobjectenabled, navDepth 1

intro overrides the site description; navDepth is the fallback depth for nodes with no isNav; sections is an array of { heading, types?, feed? } for hand-ordered ## groupings.

llmsFullTxtobjectenabled

Full-text projection. maxItems caps it; includeTypes/excludeTypes curate it.

sitemapobjectenabled, priority 0.5, changefreq weekly

Per-node values win; these are the fallbacks. excludeTypes drops whole content types.

robotsobjectenabled, both references on, aiPolicy "default"

referenceSitemap appends the Sitemap: line and referenceLlmsTxt a # LLM index: comment. aiPolicy: "default" means omit the AI-crawler blocks — set allow or disallow to emit them.

jsonLdobjectenabled, defaults true, types {}

defaults applies the built-in WebPage/Article/Event/FAQPage mapping; types overrides it per content type.

markdownobject{ enabled: false }

Path-based .md negotiation and Accept: text/markdown. The only surface that is off unless you ask.

Curation is per surface, per content type

There is no global "exclude this type from everything" switch, and that is deliberate: a type worth a sitemap entry is often not worth a full-text dump. So includeTypes/excludeTypes are set on llmsTxt and llmsFullTxt independently, sitemap takes excludeTypes only, and llmsFullTxt.maxItems caps the projection by count rather than by type. llmsTxt.sections is the one place you order by hand — each entry is a heading plus either a list of content types or the name of a feed.

That is a statement about types, not individual pages. A single node still has one switch that removes it from every surface at once: excludeFromSearch, the same flag the admin's page settings expose, is checked before any per-surface filter runs. Reach for the ax block's includeTypes/excludeTypes to shape a whole content type, and excludeFromSearch on the node to hide one page everywhere.

JSON-LD is the part that has to be code

A jsonLd.types entry maps one content type to a schema.org type, a field map, an optional FAQ source field, and a transform function that wins over all of it. That function is why the mapping cannot live in the admin: it is the escape hatch for a bespoke type, and it takes the node and a render context.

The document is built from the layout this visitor was served, after personalization arms are pruned — not from the stored layout. Building it from storage would ship the default arm's copy to a matched visitor through structured data, which is the same leak by a quieter route. See What is public about a personalized page.

Four routes, generated, in every mode

llms.txt, llms-full.txt, sitemap.xml and robots.txt are root routes the scaffold emits and the upgrade command owns — stamped landmark files, so edit one and the next upgrade refuses it. Each is four lines that hand the path to the API handler:

app/llms.txt/route.tsts
// kywi-render v2 (create-kywi-app 0.23.0) sha256:68ab1c722743
import { createAxRoute } from '@kywi-software/core/next'
import { kywi } from '../../lib/kywi'

const route = createAxRoute({ runtime: kywi, axPath: 'llms.txt' })

/** Root-level `/llms.txt` — delegates to the core AX generator (kywi-cms#55). */
export const GET = route.GET

export const dynamic = 'force-dynamic'

All four exist in headless and decoupled projects too, unlike the two app/(site) render routes: they are projections of published content for machines, not public HTML, so a project with no public front end still publishes them.