Skip to content

Commit e10ff1a

Browse files
committed
add llms.txt
1 parent c6ecbd3 commit e10ff1a

7 files changed

Lines changed: 111 additions & 3 deletions

File tree

config-geekdoc.toml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ pluralizeListTitles = false
3232
style = "github"
3333

3434
[outputs]
35-
home = [ "HTML", "SITEMAP"]
36-
section = [ "HTML" ]
37-
page = [ "HTML" ]
35+
home = [ "HTML", "SITEMAP", "Markdown"]
36+
section = [ "HTML", "Markdown" ]
37+
page = [ "HTML", "Markdown" ]
3838

3939
[outputFormats.SITEMAP]
4040
MediaType = "application/xml"
@@ -77,6 +77,9 @@ pluralizeListTitles = false
7777
"merger_cloud", "signature_cloud",
7878
"comparison_cloud"
7979
]
80+
81+
llmsTXT = true
82+
8083
[Params.Sitemap]
8184
changeFreq = "weekly"
8285
priority = 0.5
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{{ with .Site.Title -}}
2+
# {{ . }}
3+
{{- end }}
4+
5+
{{ with .Site.Params.Description -}}
6+
> {{ . }}
7+
{{- end }}
8+
{{ range (where (sort ((.Site.GetPage "/").Pages) "Weight" "asc" "Date" "desc" "Lastmod" "desc") "Params.sitemap_exclude" "ne" true) -}}
9+
{{- $link := .Permalink -}}
10+
{{- with .OutputFormats.Get "markdown" -}}
11+
{{- $link = .Permalink -}}
12+
{{- end -}}
13+
{{ printf "\n- [%s](%s): %s" .Title $link .Description }}
14+
{{- end -}}
15+
16+
{{/* Sections */}}
17+
{{- range (where (sort ((.Site.GetPage "/").Sections) "Weight" "asc" "Date" "desc" "Lastmod" "desc") "Params.sitemap_exclude" "ne" true) -}}
18+
{{ with .Title -}}
19+
## {{ . }}
20+
{{- end }}
21+
22+
{{ with .Description -}}
23+
> {{ . }}
24+
{{- end }}
25+
26+
{{ range (where (sort .Pages "Weight" "asc" "Date" "desc" "Lastmod" "desc") "Params.sitemap_exclude" "ne" true) -}}
27+
{{- $link := .Permalink -}}
28+
{{- with .OutputFormats.Get "markdown" -}}
29+
{{- $link = .Permalink -}}
30+
{{- end -}}
31+
{{ if .Title -}}
32+
- [{{ .Title }}]({{ $link }}){{ with .Description }}: {{ . }}{{ end }}
33+
{{- end }}
34+
{{ end -}}
35+
36+
{{/* Sub-Sections */}}
37+
{{ range (where (sort .Sections "Weight" "asc" "Date" "desc" "Lastmod" "desc") "Params.sitemap_exclude" "ne" true) -}}
38+
{{ with .Title -}}
39+
### {{ . }}
40+
{{- end }}
41+
42+
{{ with .Description -}}
43+
> {{ . }}
44+
{{- end }}
45+
46+
{{ range (where (sort .Pages "Weight" "asc" "Date" "desc" "Lastmod" "desc") "Params.sitemap_exclude" "ne" true) -}}
47+
{{- $link := .Permalink -}}
48+
{{- with .OutputFormats.Get "markdown" -}}
49+
{{- $link = .Permalink -}}
50+
{{- end -}}
51+
{{ if .Title -}}
52+
- [{{ .Title }}]({{ $link }}){{ with .Description }}: {{ . }}{{ end }}
53+
{{- end }}
54+
{{ end }}
55+
{{ end -}}
56+
57+
{{ end -}}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
{{ .RawContent }} {{ range .Pages }}
2+
{{ partial "docs-container.md" . }} {{ end }}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
title: "{{ .Title }}"
3+
---
4+
{{ .RawContent }}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
title: "{{ .Title }}"
3+
---
4+
{{ .RawContent }}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{{- $link := .Permalink -}}
2+
{{- with .OutputFormats.Get "markdown" -}}
3+
{{- $link = .Permalink -}}
4+
{{- end }}
5+
{{ with .Site.GetPage .RelPermalink }}
6+
{{- if .Params.index_title }}
7+
##### [{{ .Params.index_title }}]({{ $link }})
8+
{{- else if .Params.breadcrumb }}
9+
##### [{{ .Params.breadcrumb }}]({{ $link }})
10+
{{- else }}
11+
##### [{{ .LinkTitle }}]({{ $link }})
12+
{{- end }}
13+
{{ if .Params.last_updated }}
14+
* **Last updated:** {{ .Params.last_updated }}
15+
{{- end -}}
16+
{{ if .Params.categories }}
17+
* **Categories:**
18+
{{- range .Params.categories }}
19+
* {{ . }}
20+
{{- end -}}
21+
{{- end -}}
22+
{{ if .Params.tags }}
23+
* **Tags:**
24+
{{- range .Params.tags }}
25+
* {{ . }}
26+
{{- end -}}
27+
{{- end -}}
28+
{{ if .Params.brief }}
29+
30+
{{ .Params.brief }}
31+
{{- end }}
32+
{{- end }}

themes/hugo-geekdoc/layouts/robots.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,9 @@ User-agent: *
22
Disallow: /tags/*
33

44
Sitemap: {{ "sitemap.xml" | absURL }}
5+
{{/* LLMS */}}
6+
{{- $llmsGoTXT := resources.Get "llms.go.txt" -}}
7+
{{- if and $llmsGoTXT .Site.Params.llmsTXT -}}
8+
{{- $llmsTXT := $llmsGoTXT | resources.ExecuteAsTemplate "llms.txt" . -}}
9+
llms-txt: {{ $llmsTXT.Permalink }}
10+
{{- end -}}

0 commit comments

Comments
 (0)