AI-agent support
Features described in this page are experimental, and are useful for early adoption and evaluation. Output details and validation coverage may change in future releases. To track the phased evolution of the agent-support feature, see Improve support for AI-agent doc consumption #2614.
Features
When your site opts in, these are the user-facing and machine-readable behaviors Oink enables:
- Markdown output format support. Your project’s
outputsconfiguration controls which page kinds publish Markdown. - Discovery: page HTML headers include
rel="alternate"links to the Markdown version of the page. - View Markdown: page meta area includes a View Markdown link to the Markdown version of the page.
- Open in ChatGPT / Claude: documentation page actions can hand the current browser URL to either assistant. Oink builds the prompt only when the reader activates the link, preserving the deployed host, query string, and fragment.
llms.txt: site-root file listing.
The remainder of this page explains how to enable each feature, and discusses validation and metrics supported with examples.
Enable Markdown output
Hugo comes with several built-in output formats, including markdown. To
enable Markdown output, add markdown to the Hugo outputs configuration for
the page kinds you want to support. For example:
Opt pages out
By default, Hugo’s outputs map (whether in multi-file site config or page
front matter) is a full replacement for each page kind, not a merge 1.
When you add markdown, keep every format your site already relies on – for
example RSS and print on sections as is shown in the examples above.
To opt pages out of Markdown output, set outputs in page front matter to
HTML only, or whatever your page’s default output formats are while excluding
markdown. For example:
Enable llms.txt
The llms.txt format is a simple text format for listing machine-readable links
to site content. It is designed to be easy for agents to discover and parse, and
to complement the richer but more complex Markdown outputs. To learn more, see
llmstxt.org.
Oink generates llms.txt at the site root, and includes links to the home page,
main menu pages, and Markdown alternates where they exist. To enable it, add
LLMS to the Hugo outputs configuration for the home page. For example:
For an example of the generated llms.txt for this site, see
/llms.txt.
Customize output
Oink renders Markdown output via layouts/all.html and generates llms.txt
via layouts/index.llms.txt. You can override these defaults at several levels:
- Per kind — Add templates such as
home.mdor_default/single.mdunderlayouts/in your project to tailor Markdown output for specific Hugo kinds. - Per shortcode — Add output-format-specific shortcode templates to project-local shortcodes so they emit Markdown-friendly content when appropriate.
- Per page — Provide page-specific content or structure for high-value pages that need a curated agent-facing view.
Server-side support
While outside the scope of the theme, sites can facilitate agent discovery and
access to Markdown content by implementing server-side content negotiation. For
example, honoring Accept: text/markdown on the same URL as HTML.
Validation and metrics
We use AFDocs to assess basic structural support for agent-facing content,
and to validate that generated outputs meet the configured checks. We also
encourage sites to implement their own monitoring and metrics on agent access
patterns—for example logging requests to Markdown URLs or llms.txt, and
collecting metrics on their use. For details, see
Agent-support checks.
The oink.pgsty.com project contains AFDocs configuration and npm scripts
so maintainers can score a deployed URL against checks that overlap with Oink’s
agent-support goals, including Markdown URLs, llms.txt, and related categories.
Scorecard examples
For scorecard examples, see:
-
OpenTelemetry agent score online report
-
An AFDocs scorecard for this site:
oink.pgsty.comscorecardTEXT
For details on how these checks are configured, see Agent-support checks.
-
This is contrary to the documented Hugo behavior for front-matter configuration, but it is confirmed with our testing as of Hugo 0.158.0. ↩︎