Skip to content

Commit 3f02341

Browse files
committed
include llms.txt
1 parent d4704fc commit 3f02341

File tree

7 files changed

+54
-1
lines changed

7 files changed

+54
-1
lines changed

config/_default/config.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,13 @@ title = 'BetterGUI Documentation'
1212

1313
[markup.goldmark.renderer]
1414
unsafe = true
15+
16+
[outputFormats.llms]
17+
mediaType = "text/plain"
18+
baseName = "llms"
19+
isPlainText = true
20+
21+
[outputFormats.llmsfull]
22+
mediaType = "text/plain"
23+
baseName = "llms-full"
24+
isPlainText = true

config/_default/outputFormats.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[llms]
2+
baseName = "llms"
3+
isPlainText = true
4+
mediaType = "text/plain"
5+
rel = "alternate"
6+
root = true
7+
8+
[llmsfull]
9+
baseName = "llms-full"
10+
isPlainText = true
11+
mediaType = "text/plain"
12+
rel = "alternate"
13+
root = true

config/_default/outputs.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
home = ["HTML", "RSS", "PRINT"]
1+
home = ["HTML", "RSS", "PRINT", "llms", "llmsfull"]
22
section = ["HTML", "RSS", "PRINT"]
33
page = ["HTML", "RSS", "PRINT"]

layouts/llms.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- [{{ .Title }}]({{ .Permalink }})
2+
{{ range .Site.Sections }}{{ partial "section-links.txt" (dict "section" . "level" 0) }}{{ end }}

layouts/llmsfull.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# {{ .Title }}
2+
3+
{{ .RawContent -}}
4+
---
5+
{{ range $index, $section := .Site.Sections }}{{ if gt $index 0 }}
6+
---
7+
8+
{{ end }}{{ partial "section-content.txt" (dict "section" $section "level" 1) }}{{ end }}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{{ $prefix := "" }}
2+
{{ range seq .level }}{{ $prefix = printf "%s#" $prefix }}{{ end }}
3+
{{ $prefix }} {{ .section.Title | safeHTML }}
4+
{{ .section.RawContent | safeHTML -}}
5+
6+
---
7+
{{ $pageprefix := "" }}
8+
{{ range seq (add .level 1) }}{{ $pageprefix = printf "%s#" $pageprefix }}{{ end }}
9+
{{ range .section.Pages }}
10+
{{ $pageprefix }} {{ .Title | safeHTML }}
11+
{{ .RawContent | safeHTML }}
12+
---
13+
14+
{{ end }}
15+
{{ range $index, $sub := .section.Sections -}}
16+
{{ if gt $index 0 }}
17+
---
18+
{{ end }}{{ partial "section-content.txt" (dict "section" $sub "level" (add $.level 1)) }}
19+
{{- end -}}

layouts/partials/section-links.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{{ $indent := "" }}{{ range seq .level }}{{ $indent = printf "%s " $indent }}{{ end }}{{ $indent }}- [{{ .section.Title }}]({{ .section.Permalink }}){{ printf "%c" 10 }}{{ $pageindent := "" }}{{ range seq (add .level 1) }}{{ $pageindent = printf "%s " $pageindent }}{{ end }}{{ range .section.Pages }}{{ if not .IsSection }}{{ $pageindent }}- [{{ .Title }}]({{ .Permalink }}){{ printf "%c" 10 }}{{ end }}{{ end }}{{ range .section.Sections }}{{ partial "section-links.txt" (dict "section" . "level" (add $.level 1)) }}{{ end }}

0 commit comments

Comments
 (0)