# AI Links & llms Files

## 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
```toml
# src/config/config.toml
[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
```toml
# src/config/config.toml
[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.siteSummary` key of each file in `src/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]` in `config.toml`. The contact details in `llms.txt` come from its `phone`, `email`, and `address`, which ship as sample values. The theme's page layouts don't show `phone` and `address`, but `llms.txt` does, 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:

```yaml
---
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:

```toml
# src/config/config.toml
[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 models
```

Set `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`.

<Aside type="note">
  The included `public/_headers` (Netlify and Cloudflare Pages), `vercel.json`,
  and `public/.htaccess` (Apache) serve the `.md` and llms files as text, and
  send `X-Robots-Tag: noindex` with the `.md` copies so search engines don't
  index them in place of your real pages. On any other host, set the same
  headers yourself. See [Deployment](/margo/deployment/).
</Aside>

### 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
```text
Prepare the AI files of my Margo site for launch. In each file in src/i18n/, write a two-sentence
site 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]. Add
excludeFromAi: true to these pages: [PAGES], in every language. Then run npm run build and show
me the first lines of dist/llms.txt.
```