docs: use template for netlify redirects

Use a template for Netlify redirects so we
dont have to maintinan a static file manually.

Signed-off-by: Tim Jones <tim.jones@siderolabs.com>
This commit is contained in:
Tim Jones 2022-04-08 14:41:35 +02:00
parent 88f1d8fcc0
commit f2d2267e74
No known key found for this signature in database
GPG Key ID: A2A702DD5B689F45
3 changed files with 16 additions and 9 deletions

View File

@ -72,8 +72,19 @@ style = "solarized-dark"
# Comment out if you don't want the "print entire section" link enabled.
[outputs]
home = ["HTML", "RSS", "netlify_redirect"]
section = ["HTML", "print", "RSS"]
[mediaTypes.'text/prs.netlify']
suffixes = [""]
delimiter = ""
[outputFormats.netlify_redirect]
baseName = "_redirects"
isPlainText = true
mediaType = "text/prs.netlify"
notAlternative = true
[params]
copyright = "Sidero Labs, Inc."
# privacy_policy = "https://policies.google.com/privacy"

View File

@ -0,0 +1,5 @@
# Set docs/latest to the release param
/docs {{ .Site.Params.url_latest_version }} 302
/docs/* /:splat 302
/latest {{ .Site.Params.url_latest_version }} 302
/latest/* {{ .Site.Params.url_latest_version }}/:splat 302

View File

@ -1,9 +0,0 @@
## TODO: we should templatize this so hugo spits it out and it always points to latest from config.toml.
## There's a way to do it, but I couldn't get it to work quickly.
## See https://dev.to/faraixyz/setting-a-custom-output-format-in-hugo-for-netlify-or-gitlab-page-s-redirects-file-4dcf
## for what I'm talking about
/docs /v1.0 302
/docs/* /:splat 302
/latest /v1.0 302
/latest/* /v1.0/:splat 302