From 0a00dc4bb1da9470a833625f7372d8c051909490 Mon Sep 17 00:00:00 2001 From: Pete Lumbis Date: Fri, 7 Oct 2022 18:08:22 -0400 Subject: [PATCH] Updates the /docs redirect to always go to what is globally defined as the latest version Signed-off-by: Pete Lumbis --- content/docs/_index.md | 2 +- themes/crossplane/layouts/_default/redirect.html | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/content/docs/_index.md b/content/docs/_index.md index 794ed777..4e330d10 100644 --- a/content/docs/_index.md +++ b/content/docs/_index.md @@ -2,5 +2,5 @@ title: crossplane weight: 401 layout: redirect -to: https://crossplane.io/docs/v1.9/ +docs_root: true --- \ No newline at end of file diff --git a/themes/crossplane/layouts/_default/redirect.html b/themes/crossplane/layouts/_default/redirect.html index 619d2701..97339826 100644 --- a/themes/crossplane/layouts/_default/redirect.html +++ b/themes/crossplane/layouts/_default/redirect.html @@ -1 +1,5 @@ +{{ if .Params.docs_root }} +{{ partial "redirect" (dict "dest" (printf "https://crossplane.io/docs/v%s/" (string .Site.Params.latest) ) ) }} +{{ else }} {{ partial "redirect" (dict "dest" .Params.to) }} +{{ end }} \ No newline at end of file