<!-- Generated from zh/llms-txt-ghost/index.html. The canonical document is the HTML page. -->

- [ 首页 ](/zh/) 
/
- [ 如何创建 llms.txt ](/zh/how-to-create/) 
/
- Ghost            
# Ghost 中的 `llms.txt`

自 6.49.0 版起，Ghost 原生生成 llms.txt、llms-full.txt 以及公开内容的 Markdown 版本。路由变通方案现在只适用于较旧的自托管安装。

最近更新: 2026年10月29日

本页内容

- [ 简短回答 ](#answer)
- [ 启用原生文件 ](#enable)
- [ Ghost 提供的内容 ](#output)
- [ 包含哪些内容 ](#included)
- [ 较旧版本的备用方案 ](#fallbacks)
- [ 验证设置 ](#verify)             
## 简短回答

2026 年 6 月 26 日发布的 Ghost v6.49.0 “Added markdown and llms.txt support for AI tooling”（为
AI 工具添加了 Markdown 和 llms.txt 支持）。Ghost 于 2026 年 7 月 16
日在其更新日志中宣布了该功能。开启该设置后，Ghost
会根据你的公开内容生成这些文件；你无需上传或编写它们。在 Ghost(Pro)
上该功能现已可用；自托管站点需要更新才能获得它。

## 启用原生文件

- 自托管：更新到 Ghost 6.49.0 或更高版本。Ghost(Pro)：无需任何操作。 
- 在 Ghost 后台打开 **Settings** > **Meta data**。 
- 开启 **Enable structured data for LLMs and AI search engines**。 
- 打开 `https://yourdomain.com/llms.txt` 确认输出。     
警告

现有站点默认关闭

Ghost 的更新日志说明，对于现有站点，该设置默认关闭。仅升级不会发布任何内容；你必须手动开启它。

## Ghost 提供的内容

- 位于域名根路径的 `/llms.txt`。 
- `/llms-full.txt`，同样位于根路径。 
- 公开内容的 Markdown 版本：在文章 URL 后追加 `.md`，或使用 `Accept: text/markdown`
请求头请求该页面。 
- 发现用的响应头，依据是添加该功能的拉取请求。   
## 包含哪些内容

- 仅包含公开可用的内容。 
- 仅限会员和付费的文章会以其公开标题和摘要出现；其受保护的内容不包含在内。 
- 私有站点根本不提供这些文件。     
备注

自动生成，而非手动编写

原生输出会自动反映你的网站，但它不是你编写的文件。Ghost 的公告没有介绍编辑它的方法。可以将它与
生成器  生成的精选草稿进行比较，看看它是否列出了最重要的页面。

## 较旧版本的备用方案

以下路由方案早于原生功能出现，且尚未针对当前 Ghost 版本重新测试。仅在你暂时无法升级到 6.49.0
的自托管安装上使用它们，并且不要在同一路径上与原生设置组合使用。

- **content/public：** 早期的指南将文件放在服务器上的 `content/public/`
中，以便从网站根目录提供。在依赖它之前，请先发送请求确认。
`# on your Ghost server
mkdir -p content/public
cp llms.txt content/public/llms.txt
# then check https://yourdomain.com/llms.txt (restart Ghost if needed)
` 
- **routes.yaml：** 定义一个渲染纯文本模板的路由，在 **Settings, Labs**
中上传修改后的 `routes.yaml`，并向主题添加一个包含文件正文的 `llms.hbs` 模板：
`routes:
/llms.txt/:
template: llms
content_type: text/plain` 
- **重定向：** 将文件托管在其他位置，并在 **Settings, Labs, Redirects**
（`redirects.json`）中添加从 `/llms.txt` 出发的重定向。这是最简单的方法，但文件会位于你的域名之外。   
## 验证设置

```
curl -sI https://yourdomain.com/llms.txt | grep -i content-type
curl -s https://yourdomain.com/llms-full.txt | head
```

然后将该 URL 粘贴到 [验证器](/zh/validator/) 中。如果你使用的是 WordPress，请参阅
[WordPress 指南](/zh/llms-txt-wordpress/)。要正确编写文件内容，请使用
[操作指南](/zh/how-to-create/)。

## 来源

- [ Ghost 更新日志，为 AI 搜索优化你的网站（2026 年 7 月 16 日） ](https://ghost.org/changelog/geo/)
- [ Ghost v6.49.0 发布说明（2026 年 6 月 26 日） ](https://github.com/TryGhost/Ghost/releases/tag/v6.49.0)
- [ Ghost 拉取请求 #28931，Markdown 与 llms.txt 支持 ](https://github.com/TryGhost/Ghost/pull/28931)
- [ Ghost 文档，路由（routes.yaml） ](https://docs.ghost.org/themes/routing)
- [ llmstxt.org，规范参考 ](https://llmstxt.org/)
