Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ title = "Kubermatic Docs"
disableKinds = ["taxonomy"]
ignoreErrors = ["error-disable-taxonomy"]
enableRobotsTXT = true
enableGitInfo = true

[outputFormats]
[outputFormats.Search]
Expand All @@ -17,10 +18,26 @@ enableRobotsTXT = true
mediaType = "application/octet-stream"
isPlainText = true
notAlternative = true
[outputFormats.LLMsTxt]
baseName = "llms"
mediaType = "text/plain"
isPlainText = true
notAlternative = true
[outputFormats.LLMsFullTxt]
baseName = "llms-full"
mediaType = "text/plain"
isPlainText = true
notAlternative = true
[outputFormats.Markdown]
baseName = "index"
mediaType = "text/markdown"
isPlainText = true
notAlternative = true

[outputs]
home = ["HTML", "Search", "Redirects"]
section = ["HTML"]
home = ["HTML", "Search", "Redirects", "LLMsTxt", "Markdown"]
section = ["HTML", "LLMsTxt", "LLMsFullTxt", "Markdown"]
page = ["HTML", "Markdown"]

[markup.goldmark.renderer]
unsafe = true
Expand Down
1 change: 0 additions & 1 deletion content/developer-platform/_index.en.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
+++
title = "Kubermatic Developer Platform"
sitemapexclude = true
+++

KDP (Kubermatic Developer Platform) is a new Kubermatic product in development that targets the IDP
Expand Down
29 changes: 29 additions & 0 deletions layouts/_default/home.llmstxt.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# {{ .Site.Title }}

> {{ .Site.Params.description }}

> Last updated: {{ now.Format "2006-01-02" }}
> Products: {{ len (where (sort hugo.Data.products ".weight") "name" "!=" "") }}

## Products
{{ range (sort hugo.Data.products ".weight") }}
{{- $key := urlize .name -}}
{{- $values := . -}}
{{- $url := "" -}}
{{- if .versions -}}
{{- $url = (cond (gt (len .versions) 1) (index .versions 1) (index .versions 0)).release -}}
{{- end -}}
{{- $pagePath := cond (ne $url "") (printf "/%s/%s" $key $url) (printf "/%s" $key) -}}
{{- with $.Site.GetPage $pagePath -}}
{{- if not (partial "llms/is-excluded.txt" .) -}}
{{- $llmsURL := "" -}}
{{- with .OutputFormats.Get "LLMsTxt" -}}
{{- $llmsURL = .Permalink -}}
{{- end -}}
{{- if $llmsURL -}}
{{- $title := $values.title | default $values.name }}
- [{{ $title }}]({{ $llmsURL }}): {{ $values.description }}
{{ end -}}
{{- end -}}
{{- end -}}
{{- end }}
28 changes: 28 additions & 0 deletions layouts/_default/home.markdown.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{{- if not .Params.sitemapexclude -}}
---
title: {{ .Title | plainify }}
url: {{ .Permalink }}
---

# {{ .Title | plainify }}
{{ with .Description | default .Params.description }}
> {{ . }}
{{ end }}
## Products
{{ range sort hugo.Data.products "weight" }}
{{- if not .sitemapexclude -}}
{{- $key := .name | urlize -}}
{{- $version := "" -}}
{{- if .versions -}}
{{- $latest := cond (gt (len .versions) 1) (index .versions 1) (index .versions 0) -}}
{{- $version = $latest.release -}}
{{- end -}}
### {{ .title }}

{{ .description }}
{{ if $version -}}
Documentation: [/{{ $key }}/{{ $version }}/](/{{ $key }}/{{ $version }}/)
{{ end }}
{{ end -}}
{{- end -}}
{{- end -}}
3 changes: 3 additions & 0 deletions layouts/_default/home.redirects
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ https://docs.kubermatic.io/* https://docs.kubermatic.com/:splat 301!
# Optional: Redirect default Netlify subdomain to primary domain
https://cranky-newton-4e6ed2.netlify.com/* https://docs.kubermatic.com/:splat 301!

# Serve /llms.txt at the well-known discovery path for LLM agent frameworks
/.well-known/llms.txt /llms.txt 200!

/kubermatic/master/cheat_sheets/alerting_runbook/* /kubermatic/main/cheat-sheets/alerting-runbook/:splat 301!
/kubermatic/master/tutorials_howtos/oidc_provider_configuration/share-_clusters_via_delegated_oidc_authentication /kubermatic/main/tutorials-howtos/oidc-provider-configuration/share-clusters-via-delegated-oidc-authentication/ 301!
/kubermatic/master/installation/start_kkp /kubermatic/main/installation/start-kkp/ 301!
Expand Down
8 changes: 8 additions & 0 deletions layouts/_default/section.llmsfulltxt.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{{- if not (partial "llms/is-excluded.txt" .) -}}
# {{ .Title | default .Name | plainify }}
{{ with .Description | default .Params.description }}
> {{ . }}
{{ end }}
{{ partial "llms/render-content.txt" . }}
{{ partial "llms/full-content.txt" . }}
{{- end -}}
27 changes: 27 additions & 0 deletions layouts/_default/section.llmstxt.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{{- if not (partial "llms/is-excluded.txt" .) -}}
{{- $title := .Title | default .Name | plainify -}}
{{- $pageCount := partial "llms/page-count.txt" . -}}
{{- $segments := split (strings.TrimPrefix "/" (strings.TrimSuffix "/" .RelPermalink)) "/" -}}
{{- if gt $pageCount 0 -}}
# {{ $title }}
{{ with .Description | default .Params.description }}
> {{ . }}
{{ end }}
> Last updated: {{ .Lastmod.Format "2006-01-02" }}
{{- if ge (len $segments) 2 }}
> Version: {{ index $segments 1 }}
{{- end }}
> Pages: {{ $pageCount }}
{{- $llmsFullURL := "" -}}
{{- with .OutputFormats.Get "LLMsFullTxt" -}}
{{- $llmsFullURL = .Permalink -}}
{{- end -}}
{{- with $llmsFullURL }}
## About this section

- [{{ $title }} — Full Content]({{ . }})
{{ end }}
## Pages
{{ partial "llms/list-pages.txt" . }}
{{- end -}}
{{- end -}}
12 changes: 12 additions & 0 deletions layouts/_default/section.markdown.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{- if not (partial "llms/is-excluded.txt" .) -}}
---
title: {{ .Title | plainify }}
url: {{ .Permalink }}
---

# {{ .Title | plainify }}
{{ with .Description | default .Params.description }}
> {{ . }}
{{ end }}
{{ partial "llms/render-content.txt" . }}
{{- end -}}
12 changes: 12 additions & 0 deletions layouts/_default/single.markdown.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{- if not (partial "llms/is-excluded.txt" .) -}}
---
title: {{ .Title | plainify }}
url: {{ .Permalink }}
---

# {{ .Title | plainify }}
{{ with .Description | default .Params.description }}
> {{ . }}
{{ end }}
{{ partial "llms/render-content.txt" . }}
{{- end -}}
21 changes: 21 additions & 0 deletions layouts/partials/llms/full-content.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{{- /* Recursive partial: outputs full content of all descendant pages.
Context: a page (section or single).
Skips excluded pages and pages without content.
Outputs each page as a markdown section with heading + content.
Uses .RawContent via render-content.txt partial. */ -}}
{{- range .Pages -}}
{{- if not (partial "llms/is-excluded.txt" .) -}}
{{- if .RawContent -}}
{{- with .Title }}

---

## {{ . | plainify }}
{{ end -}}
{{ partial "llms/render-content.txt" . }}
{{ end -}}
{{- if .IsSection -}}
{{- partial "llms/full-content.txt" . -}}
{{- end -}}
{{- end -}}
{{- end -}}
22 changes: 22 additions & 0 deletions layouts/partials/llms/is-excluded.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{{- /* Returns true if a page should be excluded from llms.txt outputs.
Excluded when:
- .Draft is true, OR
- .Params.sitemapexclude is true, OR
- The page does not belong to the most recent product version
(2nd in the versions list from products.yaml, or 1st if only one). */ -}}
{{- $excluded := or .Draft .Params.sitemapexclude -}}
{{- if not $excluded -}}
{{- with index hugo.Data.products .Section -}}
{{- if .versions -}}
{{- $latestVersion := cond (gt (len .versions) 1) (index .versions 1).release (index .versions 0).release -}}
{{- $pathParts := split $.RelPermalink "/" -}}
{{- if gt (len $pathParts) 2 -}}
{{- $pageVersion := index $pathParts 2 -}}
{{- if ne $pageVersion $latestVersion -}}
{{- $excluded = true -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- return $excluded -}}
39 changes: 39 additions & 0 deletions layouts/partials/llms/list-pages.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{{- /* Hierarchical partial: list only direct children of the current section.
Context: a page (section).
Skips excluded pages (see llms/is-excluded partial).
Skips pages without main content.
For child sections with >10 pages, links to their llms.txt (navigate deeper).
For child sections with ≤10 pages, links to their llms-full.txt (content directly).
For single pages, lists title and description as plain text. */ -}}
{{- range .Pages -}}
{{- if not (partial "llms/is-excluded.txt" .) -}}
{{- if .RawContent -}}
{{- if .IsSection -}}
{{- $childCount := partial "llms/page-count.txt" . -}}
{{- $desc := .Description | default .Params.description | default "" -}}
{{- if gt $childCount 10 -}}
{{- $llmsTxtURL := "" -}}
{{- with .OutputFormats.Get "LLMsTxt" -}}
{{- $llmsTxtURL = .Permalink -}}
{{- end -}}
{{- if and .Title $llmsTxtURL -}}
- [{{ .Title | plainify }}]({{ $llmsTxtURL }}){{ with $desc }}: {{ . }}{{ end }}
{{ end -}}
{{- else -}}
{{- $llmsFullURL := "" -}}
{{- with .OutputFormats.Get "LLMsFullTxt" -}}
{{- $llmsFullURL = .Permalink -}}
{{- end -}}
{{- if and .Title $llmsFullURL -}}
- [{{ .Title | plainify }}]({{ $llmsFullURL }}){{ with $desc }}: {{ . }}{{ end }}
{{ end -}}
{{- end -}}
{{- else -}}
{{- if .Title -}}
{{- $desc := .Description | default .Params.description | default "" -}}
- {{ .Title | plainify }}{{ with $desc }}: {{ . }}{{ end }}
{{ end -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
14 changes: 14 additions & 0 deletions layouts/partials/llms/page-count.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{{- /* Returns the count of non-excluded pages with content under a section.
Context: a section page. */ -}}
{{- $count := 0 -}}
{{- range .Pages -}}
{{- if not (partial "llms/is-excluded.txt" .) -}}
{{- if .RawContent -}}
{{- $count = add $count 1 -}}
{{- end -}}
{{- if .IsSection -}}
{{- $count = add $count (partial "llms/page-count.txt" .) -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- return $count -}}
Loading