diff --git a/hack/release_next.sh b/hack/release_next.sh index 92869f4fc..37d73bf08 100755 --- a/hack/release_next.sh +++ b/hack/release_next.sh @@ -18,6 +18,7 @@ Given a release tag like v1.3.0, derives DOC_VERSION (v1.3) and: The /docs/v/ short path is handled dynamically by layouts/404.html, which reads Site.Params.latest_version_id and redirects. No Hugo alias is emitted for that path, so no release-time alias shuffling is needed. +The docs links in /llms.txt follow the same value (layouts/home.llms.txt). Only accepts final release tags (vX.Y.Z); pre-release tags like vX.Y.Z-rc1 are rejected — those should accumulate in next/ via update-all. diff --git a/hugo.yaml b/hugo.yaml index a2a6d87d5..25f8eb684 100644 --- a/hugo.yaml +++ b/hugo.yaml @@ -146,6 +146,9 @@ languages: languageName: English languageCode: en weight: 1 + # html and rss are the Hugo defaults; llms adds /llms.txt (see outputFormats). + outputs: + home: [html, rss, llms] params: time_format_default: 2006-01-02 time_format_blog: 2006-01-02 @@ -181,6 +184,16 @@ languages: permalinks: blog: /:section/:year/:month/:slug/ +# /llms.txt (https://llmstxt.org), rendered from layouts/home.llms.txt so its +# docs links follow params.latest_version_id. Enabled only for the English home +# page (languages.en.outputs), so no //llms.txt copies are emitted. +outputFormats: + llms: + mediaType: text/plain + baseName: llms + isPlainText: true + notAlternative: true + params: description: Cozystack — open-source cloud platform on Kubernetes for managed VMs, databases, S3 storage, and GPU workloads. CNCF Sandbox project. diff --git a/static/llms.txt b/layouts/home.llms.txt similarity index 75% rename from static/llms.txt rename to layouts/home.llms.txt index 41ad34b10..a203817de 100644 --- a/static/llms.txt +++ b/layouts/home.llms.txt @@ -1,3 +1,21 @@ +{{- /* + Served as /llms.txt. Only the English home page renders it: the llms output + format is defined in hugo.yaml and enabled under languages.en.outputs there. + + The versioned docs links follow params.latest_version_id, so promoting a new + release needs no edit here. The build fails if a linked page is missing from + the latest version, so a renamed page cannot leave a dead link behind. +*/ -}} +{{- $latest := site.Params.latest_version_id -}} +{{- $docs := dict -}} +{{- range $name, $path := dict "quickstart" "getting-started" "components" "guides/platform-stack" "architecture" "guides/concepts" -}} + {{- $ref := printf "/docs/%s/%s" $latest $path -}} + {{- with site.GetPage $ref -}} + {{- $docs = merge $docs (dict $name (printf "https://cozystack.io%s" .RelPermalink)) -}} + {{- else -}} + {{- errorf "llms.txt: %s does not exist; update the link in layouts/home.llms.txt" $ref -}} + {{- end -}} +{{- end -}} # Cozystack > Cozystack is an open-source, CNCF Sandbox cloud platform that provides Kubernetes-based, multi-tenant cloud infrastructure. Apache 2.0 license. CNCF Sandbox project since 2024-09-26. CNCF-Certified Kubernetes Distribution. Maintained by Aenix and the Cozystack community. @@ -23,9 +41,9 @@ Apache License, Version 2.0. See https://github.com/cozystack/cozystack/blob/mai ## Project documentation - [Documentation](https://cozystack.io/docs/): Full project documentation including installation, architecture, components, operations -- [Quickstart](https://cozystack.io/docs/get-started/): Get up and running with Cozystack -- [Components](https://cozystack.io/docs/components/): Detailed component reference -- [Architecture](https://cozystack.io/docs/architecture/): How Cozystack is structured +- [Quickstart]({{ $docs.quickstart }}): Get up and running with Cozystack +- [Components]({{ $docs.components }}): Detailed component reference +- [Architecture]({{ $docs.architecture }}): How Cozystack is structured ## Releases and source code