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

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

Jekyll 将任何不含 frontmatter 的文件视为静态文件。把 llms.txt 放入根目录，它就会原样发布。

最近更新: 2026年7月26日

本页内容

- [ 文件的放置位置 ](#overview)
- [ 方法：根目录中的静态文件 ](#root)
- [ 下划线和点号开头的文件 ](#exclude)
- [ 验证设置 ](#verify)            
## 文件放在哪里

Jekyll 会把任何以下划线或点开头之外、且没有 YAML front matter 的文件，直接复制到生成的 `_site` 目录，同时保留其路径。名为
`llms.txt` 位于项目根目录中的文件会提供于 `/llms.txt`.

## 方法：根目录中的静态文件

- 在仓库根目录创建文件： `touch llms.txt` 
- 编写内容时不要使用 **无前置元数据** （front matter 会使 Jekyll 尝试渲染它）：   
```
# Your Site Name

> One-sentence description of your site for LLM context.

## Core pages

- [Home](https://yourdomain.com/): what this site is about.
- [Blog](https://yourdomain.com/blog/): articles and updates.
- [About](https://yourdomain.com/about/): who maintains this site.

```

- 构建并部署： `bundle exec jekyll build`.     
示例

没有 front matter = 静态文件

即使你添加一个空的  ---  block，Jekyll 会通过 Liquid 处理该文件。 对于  llms.txt  你希望它逐字节原样复制，因此请完全省略 frontmatter。

## 下划线和点号开头的文件

Jekyll 会忽略以 `_` 或 `.` 默认如此。这不会影响 `llms.txt`，但如果以后需要此类文件，必须将其添加到
`include` 列表中，位于 `_config.yml`:

```
# _config.yml
include:
- _example.txt

```

## 验证设置

```
curl -sI https://yourdomain.com/llms.txt | grep -i content-type
# expect: content-type: text/plain
```

许多 Jekyll 网站托管在 GitHub Pages 上，后者会从域名根目录提供该文件。请参阅
[GitHub Pages 指南](/zh/llms-txt-github-pages/) 了解该设置，并参阅
[格式指南](/zh/how-to-create/) 以确保内容准确。

## 来源

- [ Jekyll 文档，静态文件 ](https://jekyllrb.com/docs/static-files/)
- [ llmstxt.org，规范参考 ](https://llmstxt.org/)
