We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cabf1c0 commit 059d759Copy full SHA for 059d759
layouts/partials/hooks/head-end.html
@@ -0,0 +1,16 @@
1
+
2
+{{ if in .RelPermalink "docs-v" -}}
3
+ {{ $canoncical := replaceRE "-v[^/]+/" "/" .RelPermalink -}}
4
+ {{ $canoncicalPath := substr $canoncical 0 -1 -}}
5
+ {{ if .GetPage $canoncicalPath -}}
6
+ <link rel="canonical" href="{{ $canoncical | absURL}}"/>
7
+ {{ else }}
8
+ {{ range .Site.Pages -}}
9
+ {{ if in .Aliases $canoncical -}}
10
+ <link rel="canonical" href="{{ .RelPermalink | absURL}}"/>
11
+ {{- end }}
12
+ {{- end}}
13
14
+{{ else if in .RelPermalink "/docs/" -}}
15
16
+{{- end}}
0 commit comments