updated canonical partial to render on every page

pull/178/head
Scott Anderson 2019-04-18 16:57:59 -06:00
parent 243bcae10e
commit 4279e2e2c2
1 changed files with 1 additions and 4 deletions

View File

@ -1,7 +1,4 @@
{{ $currentVersion := (index (findRE "[^/]+.*?" .RelPermalink) 0) .RelPermalink }}
{{ $stableVersion := $.Site.Data.versions.stable_version }}
{{ $canonicalURL := print (replaceRE `\/$` "" .Site.BaseURL) (replaceRE "[^/]+.*?[0]" $stableVersion .RelPermalink) }}
{{ if not (eq $currentVersion $stableVersion) }}
<link rel="canonical" href="{{ $canonicalURL }}" />
{{ end }}
<link rel="canonical" href="{{ $canonicalURL }}" />