Skip to content

Commit 699f97f

Browse files
committed
feat: add auto-generated llms.txt file for all localizations
1 parent 7202735 commit 699f97f

File tree

2 files changed

+52
-1
lines changed

2 files changed

+52
-1
lines changed

hugo.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ blog = "/:section/:year/:month/:day/:slug/"
8181

8282
# Be explicit about the output formats. We (currently) only want an RSS feed for the home page.
8383
[outputs]
84-
home = [ "HTML", "RSS", "HEADERS" ]
84+
home = [ "HTML", "RSS", "HEADERS", "TXT" ]
8585
page = [ "HTML"]
8686
section = [ "HTML", "print" ]
8787

@@ -101,6 +101,11 @@ baseName = "_headers"
101101
isPlainText = true
102102
notAlternative = true
103103

104+
[outputFormats.TXT]
105+
mediaType = "text/plain"
106+
baseName = "llms"
107+
isPlainText = true
108+
104109
# Image processing configuration.
105110
[imaging]
106111
resampleFilter = "CatmullRom" # cSpell:disable-line

layouts/_default/index.txt

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{{ with .Site.Title -}}
2+
# {{ . }}
3+
{{- end }}
4+
5+
{{ with .Site.Params.Description -}}
6+
> {{ . }}
7+
{{- end }}
8+
9+
{{ range (sort ((.Site.GetPage "/").Pages) "Weight" "asc" "Date" "desc" "Lastmod" "desc") -}}
10+
- [{{ .Title }}]({{ .Permalink }}): {{ .Description }}
11+
{{ end -}}
12+
13+
{{/* Sections */}}
14+
{{ range (sort ((.Site.GetPage "/").Sections) "Weight" "asc" "Date" "desc" "Lastmod" "desc") -}}
15+
{{ with .Title -}}
16+
## {{ . }}
17+
{{- end }}
18+
19+
{{ with .Description -}}
20+
> {{ . }}
21+
{{- end }}
22+
23+
{{ range (sort .Pages "Weight" "asc" "Date" "desc" "Lastmod" "desc") -}}
24+
{{ if .Title -}}
25+
- [{{ .Title }}]({{ .Permalink }}){{ with .Description }}: {{ . }}{{ end }}
26+
{{- end }}
27+
{{ end -}}
28+
29+
{{/* Sub-Sections */}}
30+
{{ range (sort .Sections "Weight" "asc" "Date" "desc" "Lastmod" "desc") -}}
31+
{{ with .Title -}}
32+
### {{ . }}
33+
{{- end }}
34+
35+
{{ with .Description -}}
36+
> {{ . }}
37+
{{- end }}
38+
39+
{{ range (sort .Pages "Weight" "asc" "Date" "desc" "Lastmod" "desc") -}}
40+
{{ if .Title -}}
41+
- [{{ .Title }}]({{ .Permalink }}){{ with .Description }}: {{ . }}{{ end }}
42+
{{- end }}
43+
{{ end }}
44+
{{ end -}}
45+
46+
{{ end -}}

0 commit comments

Comments
 (0)