From 5e1449484809bfba5d30f412fc4a8069dd5e8aac Mon Sep 17 00:00:00 2001 From: Patrice Chalin Date: Thu, 10 Mar 2022 09:12:46 -0500 Subject: [PATCH 1/2] Fix deploy 404s Signed-off-by: Patrice Chalin --- layouts/index.redirects | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/layouts/index.redirects b/layouts/index.redirects index 7f7668c1f..76d49d02a 100644 --- a/layouts/index.redirects +++ b/layouts/index.redirects @@ -1,19 +1,16 @@ -{{- $docsLatest := index site.Params.versions.docs 0 -}} -{{- $scalers := where site.RegularPages "Section" "scalers" }} -/docs /docs/{{ $docsLatest }} 301! +{{ $docsLatest := index site.Params.versions.docs 0 -}} + +/docs /docs/2.6 301! /docs/latest/* /docs/{{ $docsLatest }}/:splat -/scalers /docs/{{ $docsLatest }}/scalers 301! -/docs/scalers/* /docs/{{ $docsLatest }}/scalers/:splat -/faq /docs/{{ $docsLatest }}/faq 301! -/docs/faq/* /docs/{{ $docsLatest }}/faq/:splat -/troubleshooting /docs/{{ $docsLatest }}/troubleshooting 301! -/docs/troubleshooting/* /docs/{{ $docsLatest }}/troubleshooting/:splat -/operate /docs/{{ $docsLatest }}/operate 301! -/docs/operate/* /docs/{{ $docsLatest }}/operate/:splat -/concepts /docs/{{ $docsLatest }}/concepts 301! -/docs/concepts/* /docs/{{ $docsLatest }}/concepts/:splat -/deploy /docs/{{ $docsLatest }}deploy 301! -/docs/deploy/* /docs/{{ $docsLatest }}/deploy/:splat + +{{ $topLevel := slice "scalers" "faq" "troubleshooting" "operate" "concepts" "deploy" -}} +{{ range $name := $topLevel -}} +{{ $docp := printf "docs/%s/*" $name -}} +{{ $name | printf "/%-29s" }} /docs/{{ $docsLatest }}/{{ $name }} 301! +{{ $docp | printf "/%-29s" }} /docs/{{ $docsLatest }}/{{ $name }}/:splat +{{ end -}} + +{{ $scalers := where site.RegularPages "Section" "scalers" -}} {{- range $scalers -}} {{- $path := index (split .RelPermalink "/") 2 }} /docs/scalers/{{ $path }} /scalers/{{ $path }} From 9de0419493e9e33720e2f9cee6558cf89f2db595 Mon Sep 17 00:00:00 2001 From: Patrice Chalin Date: Tue, 22 Mar 2022 08:05:31 -0400 Subject: [PATCH 2/2] Redirect /docs to latest docs Co-authored-by: Tom Kerkhove Signed-off-by: Patrice Chalin --- layouts/index.redirects | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/index.redirects b/layouts/index.redirects index 76d49d02a..89dae239e 100644 --- a/layouts/index.redirects +++ b/layouts/index.redirects @@ -1,6 +1,6 @@ {{ $docsLatest := index site.Params.versions.docs 0 -}} -/docs /docs/2.6 301! +/docs /docs/{{ $docsLatest }} 301! /docs/latest/* /docs/{{ $docsLatest }}/:splat {{ $topLevel := slice "scalers" "faq" "troubleshooting" "operate" "concepts" "deploy" -}}