Behaviour for dynamically providing llms.txt sections.
Implement sections/0 to return a list of sections, where each section
is a tuple of {section_name, entries}.
Each entry is one of:
{name, url}— a link{name, url, description}— a link with a description{name, entries}— a sub-section (rendered as H3) containing its own entries"string"— inline markdown content rendered as-is
A section named "Optional" signals to LLMs that its content can be
skipped when context is limited.
Example
defmodule MyAppWeb.LLMsProvider do
@behaviour SEO.LLMs.Provider
@impl true
def sections do
[
{"Docs", [
{"API Reference", "/docs/api.md", "Full REST API docs"},
{"Guides", "/docs/guides.md"}
]},
{"SDKs", [
{"TypeScript", [
{"Client SDK", "/sdk/ts", "TypeScript client"},
{"Server SDK", "/sdk/ts-server"}
]},
{"Python", [
{"Client SDK", "/sdk/py"}
]}
]},
{"Optional", [
{"Changelog", "/changelog.md"}
]}
]
end
end
Summary
Types
Callbacks
@callback sections() :: [section()]