From 87b5cd40d799e901d823db23884c516cce4f24fc Mon Sep 17 00:00:00 2001 From: DANIEL KATOTO Date: Sun, 6 Sep 2026 16:10:14 +0300 Subject: [PATCH 1/5] Llms init Signed-off-by: DANIEL KATOTO --- go.mod | 1 + go.sum | 2 ++ hugo.toml | 31 +++++++++++++++++++++++---- layouts/_default/list.llms-full.txt | 1 + layouts/_default/list.llms.txt | 5 +++++ layouts/_default/single.llms-full.txt | 1 + layouts/_default/single.llms.txt | 5 +++++ 7 files changed, 42 insertions(+), 4 deletions(-) create mode 100644 layouts/_default/list.llms-full.txt create mode 100644 layouts/_default/list.llms.txt create mode 100644 layouts/_default/single.llms-full.txt create mode 100644 layouts/_default/single.llms.txt diff --git a/go.mod b/go.mod index c276ccb0a25..cb1e1902f2f 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,7 @@ module github.com/layer5io/docs go 1.26.4 require ( + github.com/gethugothemes/hugo-modules/llms-txt v0.0.0-20260701054856-10b1d2cdc11a // indirect github.com/google/docsy v0.14.3 // indirect github.com/google/docsy/dependencies v0.7.2 // indirect ) diff --git a/go.sum b/go.sum index 91e513190fb..5bfa5c1966d 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,7 @@ github.com/FortAwesome/Font-Awesome v0.0.0-20230327165841-0698449d50f2/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo= github.com/FortAwesome/Font-Awesome v0.0.0-20241216213156-af620534bfc3/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo= +github.com/gethugothemes/hugo-modules/llms-txt v0.0.0-20260701054856-10b1d2cdc11a h1:i0Vn9qzsJIHkbEn5SvI1FdvOb2nM4W5HYaHcC7n5QCc= +github.com/gethugothemes/hugo-modules/llms-txt v0.0.0-20260701054856-10b1d2cdc11a/go.mod h1:NbshvI0tQlvBA7ZZrP8kik0M6g3b0Gr0ftEP3NV+9os= github.com/google/docsy v0.14.3 h1:4uFgPWTPj4NT79IboVkXGi49LLQadLVfU4WNOfD/s74= github.com/google/docsy v0.14.3/go.mod h1:1Fj1W1O3esZh7IBQ8XAYtxtg10udBXuGI89+LUQc1AU= github.com/google/docsy/dependencies v0.7.2 h1:+t5ufoADQAj4XneFphz4A+UU0ICAxmNaRHVWtMYXPSI= diff --git a/hugo.toml b/hugo.toml index a697e6188bb..8a78acbde73 100644 --- a/hugo.toml +++ b/hugo.toml @@ -99,10 +99,11 @@ description = "Product Documentation" # Comment out if you don't want the "print entire section" link enabled. [outputs] - home = ["HTML", "RSS", "SITEMAP"] - section = ["HTML", "RSS"] - taxonomy = ["HTML", "RSS"] - term = ["HTML", "RSS"] + home = ["HTML", "RSS", "SITEMAP", "llms", "llmsfull","md"] + page = ["HTML", "llms", "llmsfull", "md"] + section = ["HTML", "RSS", "llms", "llmsfull","md"] + taxonomy = ["HTML", "RSS", "llms", "llmsfull","md"] + term = ["HTML", "RSS", "llms", "llmsfull", "md"] [sitemap] changefreq = "daily" @@ -354,3 +355,25 @@ enable = false [[module.mounts]] source = "charts" target = "static/charts" + + [[module.imports]] + path = "github.com/gethugothemes/hugo-modules/llms-txt" + +# Output formats for llms and llmsfull +[outputFormats.llms] + baseName = "llms" + mediaType = "text/plain" + isPlainText = true + notAlternative = true + +[outputFormats.llmsfull] + baseName = "llms-full" + mediaType = "text/plain" + isPlainText = true + notAlternative = true + +[llms] + enable = true + enable_full = true + include = [] + exclude = [] diff --git a/layouts/_default/list.llms-full.txt b/layouts/_default/list.llms-full.txt new file mode 100644 index 00000000000..e940b7da537 --- /dev/null +++ b/layouts/_default/list.llms-full.txt @@ -0,0 +1 @@ +{{ with .RawContent }}{{ . }}{{ else }}{{ .Plain }}{{ end }} \ No newline at end of file diff --git a/layouts/_default/list.llms.txt b/layouts/_default/list.llms.txt new file mode 100644 index 00000000000..88e58c80144 --- /dev/null +++ b/layouts/_default/list.llms.txt @@ -0,0 +1,5 @@ +# {{ .Title }} + +{{ with .Description }}{{ . }} + +{{ end }}{{ .Plain }} \ No newline at end of file diff --git a/layouts/_default/single.llms-full.txt b/layouts/_default/single.llms-full.txt new file mode 100644 index 00000000000..e940b7da537 --- /dev/null +++ b/layouts/_default/single.llms-full.txt @@ -0,0 +1 @@ +{{ with .RawContent }}{{ . }}{{ else }}{{ .Plain }}{{ end }} \ No newline at end of file diff --git a/layouts/_default/single.llms.txt b/layouts/_default/single.llms.txt new file mode 100644 index 00000000000..88e58c80144 --- /dev/null +++ b/layouts/_default/single.llms.txt @@ -0,0 +1,5 @@ +# {{ .Title }} + +{{ with .Description }}{{ . }} + +{{ end }}{{ .Plain }} \ No newline at end of file From 0966a6ed667323f089477eba1ae31c8d08c3fb39 Mon Sep 17 00:00:00 2001 From: DANIEL KATOTO Date: Sun, 6 Sep 2026 18:15:28 +0300 Subject: [PATCH 2/5] Llms output added Signed-off-by: DANIEL KATOTO --- CONTRIBUTING.md | 12 ++++++++++++ hugo.toml | 6 +++--- layouts/partials/page-llms-link.html | 5 +++++ layouts/partials/page-meta-links.html | 1 + layouts/video/video.html | 1 + 5 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 layouts/partials/page-llms-link.html diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0a1e690392c..f9a01256ecc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,6 +19,18 @@ Relevant coding style guidelines are the Go Code Review Comments and the Formatt In order to contribute to Layer5 docs, please follow the fork-and-pull request workflow described [here](./CONTRIBUTING-gitflow.md). + +# LLM-friendly page output + +Every rendered documentation page exposes a **View as markdown** link. The link +targets the page's `llms.txt` output, which contains the page title, description, +and rendered content without the site's navigation, sidebar, footer, or styling. + +This has been achieve by using Hugo Module for llms.txt and llms-full.txt +### References +- (Module post)[https://discourse.gohugo.io/t/hugo-module-for-llms-txt-and-llms-full-txt/56990] +- (Github)[https://github.com/gethugothemes/hugo-modules/tree/master/llms-txt] + ## Prerequisites Make sure you have the following prerequisites installed on your operating system before you start contributing: diff --git a/hugo.toml b/hugo.toml index 8a78acbde73..ab34d4f62ff 100644 --- a/hugo.toml +++ b/hugo.toml @@ -99,10 +99,10 @@ description = "Product Documentation" # Comment out if you don't want the "print entire section" link enabled. [outputs] - home = ["HTML", "RSS", "SITEMAP", "llms", "llmsfull","md"] + home = ["HTML", "RSS", "SITEMAP", "llms", "llmsfull", "md"] page = ["HTML", "llms", "llmsfull", "md"] - section = ["HTML", "RSS", "llms", "llmsfull","md"] - taxonomy = ["HTML", "RSS", "llms", "llmsfull","md"] + section = ["HTML", "RSS", "llms", "llmsfull", "md"] + taxonomy = ["HTML", "RSS", "llms", "llmsfull", "md"] term = ["HTML", "RSS", "llms", "llmsfull", "md"] [sitemap] diff --git a/layouts/partials/page-llms-link.html b/layouts/partials/page-llms-link.html new file mode 100644 index 00000000000..8af0c459c98 --- /dev/null +++ b/layouts/partials/page-llms-link.html @@ -0,0 +1,5 @@ +{{ with .OutputFormats.Get "llms" -}} + + View as Markdown + +{{ end -}} \ No newline at end of file diff --git a/layouts/partials/page-meta-links.html b/layouts/partials/page-meta-links.html index 1ca390641df..1b614b3900e 100644 --- a/layouts/partials/page-meta-links.html +++ b/layouts/partials/page-meta-links.html @@ -6,6 +6,7 @@ {{ $gh_project_repo := ($.Param "github_project_repo") -}} {{ $gh_branch := (default "main" ($.Param "github_branch")) -}}
+{{ partial "page-llms-link.html" . }} {{ if $gh_url -}} {{ warnf "Warning: use of `github_url` is deprecated. For details see https://www.docsy.dev/docs/adding-content/repository-links/#github_url-optional" -}} {{ T "post_edit_this" }} diff --git a/layouts/video/video.html b/layouts/video/video.html index 4782ee210ed..aefd69b13e6 100644 --- a/layouts/video/video.html +++ b/layouts/video/video.html @@ -11,6 +11,7 @@

{{ .Title }}

+ {{ partial "page-llms-link.html" . }}

{{ .Description }}

{{ if .Params.featured_video }} From eb7f4314b32fd2cd205a299a70f4aded06539ade Mon Sep 17 00:00:00 2001 From: APIPAWE KATOTO Date: Sun, 6 Sep 2026 18:54:31 +0300 Subject: [PATCH 3/5] Update CONTRIBUTING.md Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: APIPAWE KATOTO --- CONTRIBUTING.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f9a01256ecc..d444a7029e4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -26,10 +26,10 @@ Every rendered documentation page exposes a **View as markdown** link. The link targets the page's `llms.txt` output, which contains the page title, description, and rendered content without the site's navigation, sidebar, footer, or styling. -This has been achieve by using Hugo Module for llms.txt and llms-full.txt -### References -- (Module post)[https://discourse.gohugo.io/t/hugo-module-for-llms-txt-and-llms-full-txt/56990] -- (Github)[https://github.com/gethugothemes/hugo-modules/tree/master/llms-txt] +This has been achieved by using the Hugo Module for llms.txt and llms-full.txt. +## References +- [Module post](https://discourse.gohugo.io/t/hugo-module-for-llms-txt-and-llms-full-txt/56990) +- [GitHub](https://github.com/gethugothemes/hugo-modules/tree/master/llms-txt) ## Prerequisites From e442b150ddde55262c4cfa3d801f331495af84b9 Mon Sep 17 00:00:00 2001 From: DANIEL KATOTO Date: Sun, 6 Sep 2026 19:24:13 +0300 Subject: [PATCH 4/5] Fix bot reveiw Signed-off-by: DANIEL KATOTO --- hugo.toml | 8 +++----- .../_default/{list.llms-full.txt => list.llmsfull.txt} | 0 .../{single.llms-full.txt => single.llmsfull.txt} | 0 layouts/partials/page-llms-link.html | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) rename layouts/_default/{list.llms-full.txt => list.llmsfull.txt} (100%) rename layouts/_default/{single.llms-full.txt => single.llmsfull.txt} (100%) diff --git a/hugo.toml b/hugo.toml index ab34d4f62ff..c3efd7277ee 100644 --- a/hugo.toml +++ b/hugo.toml @@ -372,8 +372,6 @@ enable = false isPlainText = true notAlternative = true -[llms] - enable = true - enable_full = true - include = [] - exclude = [] +[params.llms] + generate_llms_txt = true + generate_llms_full_txt = true diff --git a/layouts/_default/list.llms-full.txt b/layouts/_default/list.llmsfull.txt similarity index 100% rename from layouts/_default/list.llms-full.txt rename to layouts/_default/list.llmsfull.txt diff --git a/layouts/_default/single.llms-full.txt b/layouts/_default/single.llmsfull.txt similarity index 100% rename from layouts/_default/single.llms-full.txt rename to layouts/_default/single.llmsfull.txt diff --git a/layouts/partials/page-llms-link.html b/layouts/partials/page-llms-link.html index 8af0c459c98..0477a98e957 100644 --- a/layouts/partials/page-llms-link.html +++ b/layouts/partials/page-llms-link.html @@ -1,4 +1,4 @@ -{{ with .OutputFormats.Get "llms" -}} +{{ with .OutputFormats.Get "md" -}} View as Markdown From 4f73efe6ec8b448022671201e8e50b533e311c75 Mon Sep 17 00:00:00 2001 From: DANIEL KATOTO Date: Mon, 7 Sep 2026 15:16:41 +0300 Subject: [PATCH 5/5] Change .Plan to .RawContent and remove duplicated config Signed-off-by: DANIEL KATOTO --- hugo.toml | 13 ------------- layouts/_default/list.llms.txt | 2 +- layouts/_default/list.llmsfull.txt | 2 +- layouts/_default/single.llms.txt | 2 +- layouts/_default/single.llmsfull.txt | 2 +- 5 files changed, 4 insertions(+), 17 deletions(-) diff --git a/hugo.toml b/hugo.toml index c3efd7277ee..933477e7541 100644 --- a/hugo.toml +++ b/hugo.toml @@ -359,19 +359,6 @@ enable = false [[module.imports]] path = "github.com/gethugothemes/hugo-modules/llms-txt" -# Output formats for llms and llmsfull -[outputFormats.llms] - baseName = "llms" - mediaType = "text/plain" - isPlainText = true - notAlternative = true - -[outputFormats.llmsfull] - baseName = "llms-full" - mediaType = "text/plain" - isPlainText = true - notAlternative = true - [params.llms] generate_llms_txt = true generate_llms_full_txt = true diff --git a/layouts/_default/list.llms.txt b/layouts/_default/list.llms.txt index 88e58c80144..a8d46de4088 100644 --- a/layouts/_default/list.llms.txt +++ b/layouts/_default/list.llms.txt @@ -2,4 +2,4 @@ {{ with .Description }}{{ . }} -{{ end }}{{ .Plain }} \ No newline at end of file +{{ end }}{{ .RawContent }} \ No newline at end of file diff --git a/layouts/_default/list.llmsfull.txt b/layouts/_default/list.llmsfull.txt index e940b7da537..7138d201f99 100644 --- a/layouts/_default/list.llmsfull.txt +++ b/layouts/_default/list.llmsfull.txt @@ -1 +1 @@ -{{ with .RawContent }}{{ . }}{{ else }}{{ .Plain }}{{ end }} \ No newline at end of file +{{ with .RawContent }}{{ . }}{{ else }}{{ .RawContent }}{{ end }} \ No newline at end of file diff --git a/layouts/_default/single.llms.txt b/layouts/_default/single.llms.txt index 88e58c80144..a8d46de4088 100644 --- a/layouts/_default/single.llms.txt +++ b/layouts/_default/single.llms.txt @@ -2,4 +2,4 @@ {{ with .Description }}{{ . }} -{{ end }}{{ .Plain }} \ No newline at end of file +{{ end }}{{ .RawContent }} \ No newline at end of file diff --git a/layouts/_default/single.llmsfull.txt b/layouts/_default/single.llmsfull.txt index e940b7da537..7138d201f99 100644 --- a/layouts/_default/single.llmsfull.txt +++ b/layouts/_default/single.llmsfull.txt @@ -1 +1 @@ -{{ with .RawContent }}{{ . }}{{ else }}{{ .Plain }}{{ end }} \ No newline at end of file +{{ with .RawContent }}{{ . }}{{ else }}{{ .RawContent }}{{ end }} \ No newline at end of file