# AI Links & llms Files

## AI Links & llms Files

**Files:** `src/config/config.toml`, `src/i18n/<lang>.json`, page frontmatter · **Skill level:** Beginner

In the Tina and Sanity editions, these settings are in **Site settings**, and the labels are in **Interface labels**. Per-page switches differ by edition, and your theme's **What Is Editable In Sanity** page says where they are, if it has them.

The theme helps visitors and AI tools read your content. Visitors can open the current page in an AI assistant or copy 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 **Copy page** and **Ask AI** links on blog posts and other detail pages                    |
| `footer`    | Shows a row in the footer with links to ask AI about the page, the Markdown copy, and the llms files |
| `providers` | Which assistants to offer: any of `chatgpt`, `claude`, `perplexity`, `grok`. `[]` hides the "Ask" links |

The labels are in each language file, under the `ai` keys in `src/i18n/<lang>.json`. 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, with a summary and your contact details |
| `/llms-full.txt`         | The text of your pages in one file                            |
| `/<page>.md`             | A Markdown copy of a content page, such as `/blog/my-post.md` |

Each language gets its own, such as `/fr/llms.txt` and `/ar/llms.txt`.

`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 language file.
- Set your address in `[site] baseUrl`, because the links in these files use it.

The last line of `llms.txt` is the theme credit. You can edit the credit under `[settings.themeCredit]` in `config.toml`.

### 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` are left out automatically.

### 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` 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](../../deployment/).
</Aside>

### Files For Developers
| File                                                | What it does                                  |
| --------------------------------------------------- | --------------------------------------------- |
| `PageActions.astro`, under `src/layouts/components/` | The **Copy page** and **Ask AI** links       |
| `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 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]". 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.
```