From 5c4242bc287a06e7db06f9ec40749a68dac0b9f7 Mon Sep 17 00:00:00 2001 From: Sridhar1030 Date: Mon, 23 Mar 2026 15:01:48 +0530 Subject: [PATCH 1/2] feat(docs): add machine-readable documentation index (llms.txt) Add llms.txt and llms-full.txt as Hugo custom output formats that auto-generate on every build, following the llmstxt.org standard. Closes #4349 Signed-off-by: Sridhar1030 --- config.toml | 15 ++++++++- layouts/index.llms.txt | 46 +++++++++++++++++++++++++++ layouts/index.llmsfull.txt | 15 +++++++++ layouts/partials/llms-full-pages.html | 16 ++++++++++ layouts/partials/llms-pages.html | 18 +++++++++++ 5 files changed, 109 insertions(+), 1 deletion(-) create mode 100644 layouts/index.llms.txt create mode 100644 layouts/index.llmsfull.txt create mode 100644 layouts/partials/llms-full-pages.html create mode 100644 layouts/partials/llms-pages.html diff --git a/config.toml b/config.toml index 6a0f748e6f..ccfc44eca4 100644 --- a/config.toml +++ b/config.toml @@ -96,8 +96,21 @@ ignoreFiles = [] ############################################################################### # Docsy - Output Formats ############################################################################### +[outputFormats.LLMS] + mediaType = "text/plain" + baseName = "llms" + isPlainText = true + notAlternative = true + +[outputFormats.LLMSFull] + mediaType = "text/plain" + baseName = "llms-full" + isPlainText = true + notAlternative = true + [outputs] -section = [ "HTML" ] + home = ["HTML", "LLMS", "LLMSFull"] + section = ["HTML"] ############################################################################### # Docsy - Goldmark markdown parser diff --git a/layouts/index.llms.txt b/layouts/index.llms.txt new file mode 100644 index 0000000000..b72f10689c --- /dev/null +++ b/layouts/index.llms.txt @@ -0,0 +1,46 @@ +{{- $docs := site.GetPage "/docs" -}} +# Kubeflow + +> Kubeflow is the foundation of tools for AI Platforms on Kubernetes, providing a composable, modular, portable, and scalable AI reference platform backed by Kubernetes-native projects covering every stage of the AI lifecycle. + +Kubeflow enables AI platform teams to build production-ready ML workflows with tools for training, tuning, serving, pipelines, and notebooks. Each Kubeflow project can be used independently or as part of the full AI reference platform. + +- Source code: +- Documentation: <{{ site.BaseURL }}docs/> +{{ range $docs.Sections.ByWeight -}} + {{- if eq .RelPermalink "/docs/components/" -}} + {{- range .Sections.ByWeight -}} + {{- $sec := . -}} + {{- $t := replace (replace $sec.Title "'" "'") "&" "&" -}} + {{- printf "\n## %s\n\n" $t -}} + {{- if $sec.Params.description -}} + {{- $d := replace (replace $sec.Params.description "'" "'") "&" "&" -}} + {{- printf "- [%s](%s): %s\n" $t $sec.Permalink $d -}} + {{- else -}} + {{- printf "- [%s](%s)\n" $t $sec.Permalink -}} + {{- end -}} + {{- partial "llms-pages.html" (dict "section" $sec "legacy" false) -}} + {{- end -}} + {{- else -}} + {{- $sec := . -}} + {{- $t := replace (replace $sec.Title "'" "'") "&" "&" -}} + {{- printf "\n## %s\n\n" $t -}} + {{- if $sec.Params.description -}} + {{- $d := replace (replace $sec.Params.description "'" "'") "&" "&" -}} + {{- printf "- [%s](%s): %s\n" $t $sec.Permalink $d -}} + {{- else -}} + {{- printf "- [%s](%s)\n" $t $sec.Permalink -}} + {{- end -}} + {{- partial "llms-pages.html" (dict "section" $sec "legacy" false) -}} + {{- end -}} +{{- end -}} +{{- printf "\n## Optional\n\nLegacy (v1) documentation for components that have been upgraded. These pages are kept for historical reference.\n\n" -}} +{{- range $docs.Sections.ByWeight -}} + {{- if eq .RelPermalink "/docs/components/" -}} + {{- range .Sections.ByWeight -}} + {{- partial "llms-pages.html" (dict "section" . "legacy" true) -}} + {{- end -}} + {{- else -}} + {{- partial "llms-pages.html" (dict "section" . "legacy" true) -}} + {{- end -}} +{{- end -}} diff --git a/layouts/index.llmsfull.txt b/layouts/index.llmsfull.txt new file mode 100644 index 0000000000..ebf1df4537 --- /dev/null +++ b/layouts/index.llmsfull.txt @@ -0,0 +1,15 @@ +{{- $docs := site.GetPage "/docs" -}} +# Kubeflow — Full Documentation Index + +> Kubeflow is the foundation of tools for AI Platforms on Kubernetes, providing a composable, modular, portable, and scalable AI reference platform backed by Kubernetes-native projects covering every stage of the AI lifecycle. +{{ range $docs.Sections.ByWeight -}} + {{- if eq .RelPermalink "/docs/components/" -}} + {{- range .Sections.ByWeight -}} + {{- printf "\n## %s\n\n" .Title -}} + {{- partial "llms-full-pages.html" (dict "section" .) -}} + {{- end -}} + {{- else -}} + {{- printf "\n## %s\n\n" .Title -}} + {{- partial "llms-full-pages.html" (dict "section" .) -}} + {{- end -}} +{{- end -}} diff --git a/layouts/partials/llms-full-pages.html b/layouts/partials/llms-full-pages.html new file mode 100644 index 0000000000..a67132db42 --- /dev/null +++ b/layouts/partials/llms-full-pages.html @@ -0,0 +1,16 @@ +{{- $section := .section -}} +{{- range $section.Pages.ByWeight -}} + {{- $p := . -}} + {{- printf "### [%s](%s)\n" $p.Title $p.Permalink | safeHTML -}} + {{- with $p.Params.description -}} + {{- printf "> %s\n" . | safeHTML -}} + {{- end -}} + {{- printf "\n" -}} + {{- with $p.RawContent -}} + {{- printf "%s\n" (. | replaceRE `\{\{[<%].*?[>%]\}\}` "") | safeHTML -}} + {{- end -}} + {{- printf "\n" -}} + {{- if $p.IsSection -}} + {{- partial "llms-full-pages.html" (dict "section" $p) -}} + {{- end -}} +{{- end -}} diff --git a/layouts/partials/llms-pages.html b/layouts/partials/llms-pages.html new file mode 100644 index 0000000000..450644912b --- /dev/null +++ b/layouts/partials/llms-pages.html @@ -0,0 +1,18 @@ +{{- $section := .section -}} +{{- $legacy := .legacy -}} +{{- range $section.Pages.ByWeight -}} + {{- $p := . -}} + {{- $isLeg := in $p.RelPermalink "legacy-v1" -}} + {{- if eq $legacy $isLeg -}} + {{- if $p.Params.description -}} + {{- printf "- [%s](%s): %s\n" $p.Title $p.Permalink $p.Params.description | safeHTML -}} + {{- else -}} + {{- printf "- [%s](%s)\n" $p.Title $p.Permalink | safeHTML -}} + {{- end -}} + {{- end -}} + {{- if $p.IsSection -}} + {{- if or $legacy (not $isLeg) -}} + {{- partial "llms-pages.html" (dict "section" $p "legacy" $legacy) -}} + {{- end -}} + {{- end -}} +{{- end -}} From 191780c301c892433287d2df14fcdeed620bffd0 Mon Sep 17 00:00:00 2001 From: Sridhar1030 Date: Mon, 23 Mar 2026 15:27:05 +0530 Subject: [PATCH 2/2] added nav and footer links Signed-off-by: Sridhar1030 --- config.toml | 19 +++++++++++++++++++ layouts/partials/footer.html | 1 + layouts/partials/head.html | 2 ++ layouts/partials/navbar.html | 17 +++++++++++++++++ 4 files changed, 39 insertions(+) diff --git a/config.toml b/config.toml index ccfc44eca4..a29eaa589d 100644 --- a/config.toml +++ b/config.toml @@ -92,6 +92,25 @@ ignoreFiles = [] weight = -99 pre = "" url = "https://github.com/kubeflow/" + [[menu.main]] + name = "AI-Ready Docs" + identifier = "llms" + weight = -98 + pre = "" + [[menu.main]] + name = "llms.txt" + parent = "llms" + weight = 1 + pre = "" + post = "
Curated index" + url = "/llms.txt" + [[menu.main]] + name = "llms-full.txt" + parent = "llms" + weight = 2 + pre = "" + post = "
Full documentation" + url = "/llms-full.txt" ############################################################################### # Docsy - Output Formats diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 0f18fd9880..a9e730ba87 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -33,6 +33,7 @@ {{ end }}

Website Privacy Policy + | llms.txt · llms-full.txt

{{ if not .Site.Params.ui.footer_about_disable }} {{ with .Site.GetPage "about" }}

{{ .Title }}

{{ end }} diff --git a/layouts/partials/head.html b/layouts/partials/head.html index c6083f8326..ef49c51790 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -4,6 +4,8 @@ {{ range .AlternativeOutputFormats -}} {{ end -}} + + {{ $outputFormat := partial "outputformat.html" . -}} {{ if and hugo.IsProduction (ne $outputFormat "print") -}} diff --git a/layouts/partials/navbar.html b/layouts/partials/navbar.html index 075778e402..621094a8ac 100644 --- a/layouts/partials/navbar.html +++ b/layouts/partials/navbar.html @@ -39,6 +39,22 @@ {{ range $i, $e := .Site.Menus.main -}} {{ $longContent := gt (len $e.Name) 8 -}} {{ $isLast := eq $i (sub $last 1) -}} + {{ if $e.HasChildren -}} + + {{ else -}} {{ end -}} + {{ end -}}