layouts/_default/LLMS-TXT-README.md
This directory contains Hugo templates for automatically generating llms.txt files following the llmstxt.org specification.
The llms.txt format helps LLMs discover and understand documentation structure. Hugo automatically generates these files during the build process.
index.llms.txt/layouts/index.llms.txt/llms.txt (site-level)data/products.yml with:
section.llms.txt/layouts/_default/section.llms.txt/influxdb3/core/llms.txt)data/products.ymlIn config/_default/hugo.yml:
outputFormats:
llmstxt:
mediaType: text/plain
baseName: llms
isPlainText: true
notAlternative: true
permalinkable: true
suffixes:
- txt
outputs:
section:
- HTML
- llmstxt # Generates llms.txt for all sections
home:
- HTML
- llmstxt # Generates root /llms.txt
After building with hugo:
public/
├── llms.txt # Site-level discovery file
├── influxdb3/
│ ├── core/
│ │ ├── llms.txt # InfluxDB 3 Core product index
│ │ ├── get-started/
│ │ │ └── llms.txt # Section-level index
│ │ └── query-data/
│ │ └── llms.txt # Section-level index
│ ├── cloud-dedicated/
│ │ └── llms.txt # Cloud Dedicated product index
│ └── cloud-serverless/
│ └── llms.txt # Cloud Serverless product index
├── telegraf/
│ └── v1/
│ └── llms.txt # Telegraf product index
└── flux/
└── v0/
└── llms.txt # Flux product index
[Title](url): DescriptionEdit /layouts/index.llms.txt directly. This file is hardcoded for precise curation of top-level products.
The /layouts/_default/section.llms.txt template automatically generates llms.txt files for all sections.
To customize a specific product's llms.txt:
Create a product-specific template following Hugo's lookup order:
layouts/influxdb3/core/section.llms.txt # Specific to Core
layouts/influxdb3/section.llms.txt # All InfluxDB 3 products
layouts/_default/section.llms.txt # Default for all
Example: Custom template for InfluxDB 3 Core
Create /layouts/influxdb3/core/section.llms.txt:
# InfluxDB 3 Core
> InfluxDB 3 Core is the open source, high-performance time series database.
{{- /* Custom curated sections */ -}}
## Getting Started
- [Install InfluxDB 3 Core](/influxdb3/core/install/): Installation guide
- [Quick start](/influxdb3/core/get-started/): Get started in 5 minutes
## Guides
- [Write data](/influxdb3/core/write-data/): Write data guide
- [Query with SQL](/influxdb3/core/query-data/sql/): SQL query guide
The template accesses product metadata:
{{- $product := index .Site.Data.products "influxdb3_core" -}}
{{- $productName := $product.name -}} {}
{{- $productAltname := $product.altname -}} {}
{{- $productVersion := $product.latest -}} {}
# Build Hugo site
./node_modules/.bin/hugo --quiet
# Check generated llms.txt files
ls -la public/llms.txt
ls -la public/influxdb3/core/llms.txt
# View content
cat public/llms.txt
cat public/influxdb3/core/llms.txt
Check that generated files follow llmstxt.org spec:
[Title](url): Description# Test with curl (simulates LLM access)
curl https://docs.influxdata.com/llms.txt
curl https://docs.influxdata.com/influxdb3/core/llms.txt
# Verify content type
curl -I https://docs.influxdata.com/llms.txt
# Should return: Content-Type: text/plain
llms.txt files are automatically generated during:
hugo server regenerates on file changeshugo --quiet generates all llms.txt filesdata/products.ymlsection.llms.txt templatelayouts/<product>/section.llms.txtEdit /layouts/index.llms.txt to add/remove product links.
Problem: llms.txt file not generated
Solution: Check that output format is configured in config/_default/hugo.yml
Problem: Content includes HTML tags
Solution: Use | plainify filter in template
Problem: URLs are absolute instead of relative
Solution: Use .RelPermalink instead of .Permalink