Skip to content

Commit

Permalink
Fix deploy 404s (kedacore#708)
Browse files Browse the repository at this point in the history
Co-authored-by: Tom Kerkhove <[email protected]>
Signed-off-by: Patrice Chalin <[email protected]>
  • Loading branch information
chalin and tomkerkhove authored Mar 22, 2022
1 parent 3904255 commit 7550dc0
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions layouts/index.redirects
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
{{- $docsLatest := index site.Params.versions.docs 0 -}}
{{- $scalers := where site.RegularPages "Section" "scalers" }}
{{ $docsLatest := index site.Params.versions.docs 0 -}}

/docs /docs/{{ $docsLatest }} 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 }}
Expand Down

0 comments on commit 7550dc0

Please sign in to comment.