diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0a1e690392c..170aacccb08 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,6 +19,16 @@ 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). + +# Markdown export for pages + +Every rendered documentation page exposes a **View as Markdown** link. The link +points to that page's Markdown output, which includes the page title, description, +and rendered content without the site's navigation, sidebar, footer, or styling. + +This output is generated by Hugo's built-in Markdown rendering for page content and is +intended to make documentation easier to reuse in AI and downstream tooling. + ## Prerequisites Make sure you have the following prerequisites installed on your operating system before you start contributing: 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..6ccbbf48f4f 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", "md"] + section = ["HTML", "RSS", "md"] + taxonomy = ["HTML", "RSS", "md"] + term = ["HTML", "RSS", "md"] [sitemap] changefreq = "daily" @@ -354,3 +355,10 @@ enable = false [[module.mounts]] source = "charts" target = "static/charts" + + [[module.imports]] + path = "github.com/gethugothemes/hugo-modules/llms-txt" + +[params.llms] + generate_llms_txt = true + generate_llms_full_txt = true diff --git a/layouts/partials/page-markdown-link.html b/layouts/partials/page-markdown-link.html new file mode 100644 index 00000000000..0477a98e957 --- /dev/null +++ b/layouts/partials/page-markdown-link.html @@ -0,0 +1,5 @@ +{{ with .OutputFormats.Get "md" -}} + + 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..cdcfd8d7df9 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")) -}}