AI Links & llms Files
Files: src/config/config.toml, src/i18n/<language>.json, page frontmatter · Skill level: Beginner
Margo helps visitors and AI tools read your content. Visitors can ask an AI assistant about the current page or read it as Markdown, and tools can read a plain index of your site. Everything here works from your own content and needs no account.
Ask AI And Copy Page Links
[settings.pageActions] enable = true footer = true providers = ["chatgpt", "claude", "perplexity", "grok"]| Setting | What it does |
|---|---|
enable | Shows a Copy page menu next to Copy link at the end of each journal post: copy the post as Markdown, open its Markdown copy, or ask an assistant about it |
footer | Shows a row at the bottom of every footer layout: Ask AI about this page with one link per assistant, and Read with AI with this page’s Markdown copy, llms.txt, and llms-full.txt |
providers | Which assistants to offer: any of chatgpt, claude, perplexity, grok. [] hides the “Ask” links |
Copying a page and its Markdown link need markdownPages below; the llms links need llmsTxt. The labels are under ai in each src/i18n/<language>.json, for example ai.copyPage (“Copy page”) and ai.footerAsk (“Ask AI about this page”). Change them in every language.
The llms Files
[seo.ai] llmsTxt = true markdownPages = true| Address | What it holds |
|---|---|
/llms.txt | A Markdown index of your site: your title and description, a short summary, then links to your pages, projects, services, journal posts, and team, and your contact details |
/llms-full.txt | The text of your pages in one file |
/<page>.md | A Markdown copy of a project, service, journal post, team member, legal page, or the pricing and FAQ pages, such as /projects/ceramic-forms.md |
Each language gets its own, such as /fr/llms.txt and /ar/llms.txt. Pages with a Markdown copy also point to it from their <head>, so tools can find it.
llms.txt is a proposed convention that some AI tools and coding agents read. Search engines don’t document using these files, so treat them as a convenience, not as an SEO setting.
Before launch:
- Write your own site summary in the
ai.siteSummarykey of each file insrc/i18n/. It ships with a sample that describes an independent designer and photographer. - Set your address in
[site] baseUrl, because the links in these files use it. - Check
[settings.contactInfo]inconfig.toml. The contact details inllms.txtcome from itsphone,email, andaddress, which ship as sample values. The theme’s page layouts don’t showphoneandaddress, butllms.txtdoes, so replace them or leave them empty ("").
The last line of llms.txt is the theme credit, editable in config.toml under [settings.themeCredit].
Leave A Page Out
Add excludeFromAi to the frontmatter of the page:
---title: "Internal notes"excludeFromAi: true---The page is left out of the llms files and gets no Markdown copy. Pages marked noindex and drafts are left out automatically. The sample shortcode page /components/ ships with excludeFromAi: true.
Choose Which AI Crawlers May Visit
/robots.txt is built from your settings:
[seo.robotsTxt] enable = true disallow = [] aiSearch = true # AI answer engines that fetch pages to cite them aiTraining = true # crawlers that collect content to train AI modelsSet aiSearch or aiTraining to false to ask those crawlers to stay away. robots.txt also gets a Content-Signal line that states the same two choices. robots.txt is a request, and not every crawler follows it. The list of crawlers is in src/lib/utils/aiCrawlers.ts.
Files For Developers
| File | What it does |
|---|---|
src/layouts/components/widgets/PageActions.astro | The Copy page menu on journal posts |
src/layouts/components/global/footer/FooterAi.astro | The footer row |
src/lib/utils/aiContent.ts | Builds the text for the llms and .md routes |
src/lib/utils/aiCrawlers.ts | The crawler lists for robots.txt |
src/pages/[...lang]/llms.txt.ts | The llms.txt route |
src/pages/[...lang]/llms-full.txt.ts | The llms-full.txt route |
src/pages/[...path].md.ts | The Markdown copies |
src/pages/robots.txt.ts | The robots.txt route |
Do It With AI
Prepare the AI files of my Margo site for launch. In each file in src/i18n/, write a two-sentencesite summary in the ai.siteSummary key, in that file's language, based on this description:[DESCRIPTION]. Check that [site] baseUrl in src/config/config.toml is "[MY URL]", and set phone,email, and address in [settings.contactInfo] to [MY DETAILS, or "" to leave one out]. AddexcludeFromAi: true to these pages: [PAGES], in every language. Then run npm run build and showme the first lines of dist/llms.txt.