diff --git a/_quarto.yml b/_quarto.yml index 30af73472..2334454ac 100644 --- a/_quarto.yml +++ b/_quarto.yml @@ -314,6 +314,7 @@ website: - docs/websites/website-drafts.qmd - docs/websites/website-search.qmd - docs/websites/website-tools.qmd + - docs/websites/website-llms.qmd - docs/websites/website-about.qmd - section: "Listing Pages" href: docs/websites/website-listings.qmd diff --git a/docs/websites/website-llms.qmd b/docs/websites/website-llms.qmd new file mode 100644 index 000000000..4aafb461b --- /dev/null +++ b/docs/websites/website-llms.qmd @@ -0,0 +1,41 @@ +--- +title: llms.txt Output +--- + +## Overview + +Quarto can generate [llms.txt](https://llmstxt.org/) format output for your website, making your content more accessible to large language models and AI-powered tools. When enabled, Quarto creates an `llms.txt` index file and `.llms.md` markdown files for each page. + +## Enabling `llms.txt` + +To enable `llms.txt` output, add `llms-txt: true` to your website configuration: + +```{.yaml filename="_quarto.yml"} +website: + title: "My Documentation" + llms-txt: true +``` + +## Generated Output + +When you render your site, Quarto generates two types of files: + +### `llms.txt` Index + +An `llms.txt` file is created at the root of your site. This index lists all pages with their titles, using your site's title and description from the website configuration. + +### Markdown Files + +For each HTML page, a corresponding `.llms.md` file is created alongside it (e.g., `guide.html` gets `guide.llms.md`). These contain clean markdown versions of your content. + +## Content Conversion + +HTML content is converted to markdown using Pandoc. Navigation elements, sidebars, footers, and scripts are removed. Tables, code blocks, callouts, and images are converted to standard markdown formats. Internal links are automatically rewritten from `.html` to `.llms.md` extensions. + +## Draft Handling + +Draft pages are automatically excluded from both `.llms.md` generation and the `llms.txt` index. The 404 page is also excluded from the index. + +## Build Behavior + +On full builds, all `.llms.md` files and the `llms.txt` index are regenerated. On incremental builds, individual `.llms.md` files are updated but `llms.txt` is preserved, matching the behavior of sitemap generation.