feat: add dynamic latest API redirects via Hugo templatin
parent
dbfb690ee9
commit
f6b6444f0b
|
|
@ -38,3 +38,6 @@ nohup.out
|
|||
# Generated files when building with make container-build
|
||||
.config/
|
||||
.npm/
|
||||
|
||||
# Local Netlify folder
|
||||
.netlify
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ blog = "/:section/:year/:month/:day/:slug/"
|
|||
|
||||
# Be explicit about the output formats. We (currently) only want an RSS feed for the home page.
|
||||
[outputs]
|
||||
home = [ "HTML", "RSS", "HEADERS" ]
|
||||
home = [ "HTML", "RSS", "HEADERS", "REDIRECTS"]
|
||||
page = [ "HTML"]
|
||||
section = [ "HTML", "print" ]
|
||||
|
||||
|
|
@ -101,6 +101,13 @@ baseName = "_headers"
|
|||
isPlainText = true
|
||||
notAlternative = true
|
||||
|
||||
# _redirects file output (uses the template at layouts/index.redirects)
|
||||
[outputFormats.REDIRECTS]
|
||||
mediatype = "text/netlify"
|
||||
baseName = "_redirects"
|
||||
isPlainText = true
|
||||
notAlternative = true
|
||||
|
||||
# Image processing configuration.
|
||||
[imaging]
|
||||
resampleFilter = "CatmullRom" # cSpell:disable-line
|
||||
|
|
|
|||
|
|
@ -0,0 +1,15 @@
|
|||
{{- $latest := or .Site.Params.latest (errorf "missing .Site.Params.latest") -}}
|
||||
|
||||
###############################################
|
||||
# set server-side redirects in this file #
|
||||
# see https://www.netlify.com/docs/redirects/ #
|
||||
# test at https://play.netlify.com/redirects #
|
||||
###############################################
|
||||
|
||||
# Dynamic latest API redirect - automatically points to current latest version
|
||||
/docs/reference/generated/kubernetes-api/latest/ /docs/reference/generated/kubernetes-api/{{ $latest }}/ 301
|
||||
/docs/reference/generated/kubernetes-api/latest/* /docs/reference/generated/kubernetes-api/{{ $latest }}/:splat 301
|
||||
|
||||
# Include all existing static redirects
|
||||
{{- $staticRedirects := readFile "static/_redirects.base" -}}
|
||||
{{ $staticRedirects }}
|
||||
Loading…
Reference in New Issue