Fix for docs redirects (#2895)

* Fixing redirects

Signed-off-by: jonasrosland <jrosland@vmware.com>

* Fix netlify config

Signed-off-by: jonasrosland <jrosland@vmware.com>

* Add previous redirects

Signed-off-by: jonasrosland <jrosland@vmware.com>

* Change netlify publish path

Signed-off-by: jonasrosland <jrosland@vmware.com>

* Add new redirect for restic

Signed-off-by: jonasrosland <jrosland@vmware.com>
This commit is contained in:
Jonas Rosland
2020-09-02 17:20:46 -04:00
committed by GitHub
parent be1cd03023
commit a179ae01ca
5 changed files with 25 additions and 8 deletions

View File

@@ -88,7 +88,7 @@ enableGitInfo: true
permalinks:
posts: "/blog/:slug/"
outputs:
home: ["HTML"]
home: [ "HTML", "REDIRECTS" ]
section: ["HTML"]
page: ["HTML"]
taxonomy: ["HTML"]
@@ -104,3 +104,11 @@ markup:
noClasses: true
style: monokai
tabWidth: 4
mediaTypes:
"text/netlify":
delimiter: ""
outputFormats:
REDIRECTS:
mediaType: "text/netlify"
baseName: "_redirects"

View File

@@ -8,7 +8,7 @@
<link rel="icon" href="/favicon.ico" type="image/x-icon">
{{ $options := (dict "targetPath" "styles.css" "outputStyle" "compressed" "enableSourceMap" true) }}
{{ $styles := resources.Get "styles.scss" | toCSS $options | resources.Fingerprint }}
<link rel="stylesheet" href="{{ $styles.Permalink | relURL }}" integrity="{{ $styles.Data.Integrity }}">
<link rel="stylesheet" href="{{ $styles.RelPermalink }}" integrity="{{ $styles.Data.Integrity }}">
{{ block "title" . }}<title>{{ .Site.Title }} {{ .Page.Title }}</title>{{ end }}
</head>
<body id="{{ .CurrentSection.Params.id }}">

View File

@@ -14,11 +14,6 @@
<title>{{ .Site.Title }} Docs - {{ .Title }}</title>
{{ end }}
{{ if not (isset .CurrentSection.Params "version") }}
{{ $latest_url := replace .Permalink "/docs" (printf "/docs/%s" .Site.Params.latest) | relURL }}
<meta http-equiv="refresh" content="0; URL={{ $latest_url }}" />
{{ end }}
<body id="docs">
<div class="container-fluid site-outer-container">
<div class="site-container">

View File

@@ -0,0 +1,14 @@
{{ $versions := site.Params.versions }}
{{ $latest := site.Params.latest }}
/docs /docs/{{ $latest }} 301!
/docs/latest /docs/{{ $latest }}
/docs/latest/* /docs/{{ $latest }}/:splat
/docs/troubleshooting /docs/{{ $latest }}/troubleshooting
/docs/supported-providers /docs/{{ $latest }}/supported-providers
/docs/zenhub /docs/{{ $latest }}/zenhub
/docs/install-overview /docs/{{ $latest }}/basic-install
/docs/start-contributing /docs/{{ $latest }}/start-contributing
/docs/customize-installation /docs/{{ $latest }}/customize-installation
/docs/faq /docs/{{ $latest }}/faq
/docs/csi /docs/{{ $latest }}/csi
/docs/restic /docs/{{ $latest }}/restic

View File

@@ -6,6 +6,6 @@
<link rel="icon" href="/favicon.ico" type="image/x-icon">
{{ $options := (dict "targetPath" "styles.css" "outputStyle" "compressed" "enableSourceMap" true) }}
{{ $styles := resources.Get "styles.scss" | toCSS $options | resources.Fingerprint }}
<link rel="stylesheet" href="{{ $styles.Permalink | relURL }}" integrity="{{ $styles.Data.Integrity }}">
<link rel="stylesheet" href="{{ $styles.RelPermalink }}" integrity="{{ $styles.Data.Integrity }}">
{{/* TODO {% seo %}*/}}
</head>