Skip to content

Commit b4d2132

Browse files
committed
Updates to generate site summaries for LLMs
1 parent a24444d commit b4d2132

3 files changed

Lines changed: 69 additions & 2 deletions

File tree

‎config.toml‎

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,17 +189,56 @@ enable = false
189189
url = "https://www.reddit.com/r/Clickhouse/"
190190
icon = "fab fa-reddit"
191191
desc = "Altinity on Reddit"
192+
[params.llms]
193+
# Set to false to disable /llms.txt generation
194+
generate_llms_txt = true
195+
196+
# Set to false to disable /llms-full.txt generation
197+
generate_llms_full_txt = true
198+
199+
# Include only specific pages or directories.
200+
# If empty, all pages are included by default.
201+
# If populated, ONLY paths matching the list will be generated.
202+
# Both llms.txt and llms-full.txt respect this setting.
203+
# Examples:
204+
# "/about/" → include strictly the /about/ page
205+
# "/blog/*" → include immediate children of /blog/ (e.g. /blog/post-1/)
206+
# "/blog/**" → include /blog/ and all nested pages and directories
207+
include = []
208+
209+
# Exclude specific pages or directories.
210+
# Follows the same wildcard formats as include.
211+
# Conflict handling: If the EXACT same path string is put in both include and exclude,
212+
# the include rule has higher priority (the exclude rule is ignored).
213+
# Both llms.txt and llms-full.txt respect this setting.
214+
# Examples:
215+
# "/about/" → exclude exactly /about/
216+
# "/blog/**" → exclude all pages under /blog/
217+
# "/blog/post-1/" → exclude a specific page
218+
exclude = []
192219
[outputFormats]
193220
[outputFormats.PRINT]
194221
baseName = "index"
195222
isHTML = true
196223
mediaType = "text/html"
197224
path = "printview"
198225
permalinkable = false
226+
[outputFormats.llms]
227+
baseName = "llms"
228+
isPlainText = true
229+
mediaType = "text/plain"
230+
rel = "alternate"
231+
root = true
232+
[outputFormats.llmsfull]
233+
baseName = "llms-full"
234+
mediaType = "text/plain"
235+
isPlainText = true
236+
notAlternative = true
237+
root = true
199238

200239
# Controls the ability to print.
201240
[outputs]
202-
#home = ["HTML", "print"]
241+
home = ["HTML", "print", "llms","llmsfull", "md"]
203242
section = [ "HTML", "print"]
204243
#page = ["HTML", "print"]
205244

@@ -208,4 +247,4 @@ section = [ "HTML", "print"]
208247
[[module.imports]]
209248
path = "github.com/google/docsy"
210249
[[module.imports]]
211-
path = "github.com/google/docsy/dependencies"
250+
path = "github.com/google/docsy/dependencies"

‎layouts/index.llms.txt‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# {{ .Site.Title }}
2+
> {{ .Site.Params.description | default .Site.Title }}
3+
4+
## Pages
5+
{{- range (where .Site.RegularPages "Language.Lang" "en") }}
6+
- [{{ .Title }}]({{ .Permalink }}): {{ .Description | default .Summary | truncate 150 }}
7+
{{- with .Params.keywords }}
8+
*Keywords: {{ delimit . ", " }}*
9+
{{- end }}
10+
{{- end }}

‎layouts/index.llmsfull.txt‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# {{ .Site.Title }} - Full Content
2+
{{- range (where .Site.RegularPages "Language.Lang" "en") }}
3+
---
4+
title: {{ .Title }}
5+
url: {{ .Permalink }}
6+
---
7+
8+
{{- /* 1. Get the raw content to avoid the 'plainify' disappearing act */ -}}
9+
{{- $text := .RawContent -}}
10+
11+
{{- /* 2. Replace the encoded brackets with simple ones so the LLM understands them */ -}}
12+
{{- $text = replace $text "&lt;" "<" -}}
13+
{{- $text = replace $text "&gt;" ">" -}}
14+
15+
{{- /* 3. Output the content. The LLM will ignore the Hugo brackets. */ -}}
16+
{{ $text | safeHTML }}
17+
18+
{{ end -}}

0 commit comments

Comments
 (0)