Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/htr3n/hyde-hyde.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvano Cerza <silvanocerza@gmail.com>2021-04-16 17:45:25 +0300
committerSilvano Cerza <silvanocerza@gmail.com>2021-04-16 17:45:27 +0300
commit4faf3de5540dc3f7ecfcd1463e015cfe73492967 (patch)
tree3705a2aad4312d3b31db35c52d3450c0c627bbe5
parent50558ed9bb03d3d8e84ddcb1b76b8f582e388308 (diff)
Add canonical URL link in header.html
By default the page permalink is used, if necessary a custom canonicalUrl parameter can be set in a page front matter.
-rw-r--r--layouts/partials/header.html5
1 files changed, 5 insertions, 0 deletions
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
index 4d918e1..2c7cfad 100644
--- a/layouts/partials/header.html
+++ b/layouts/partials/header.html
@@ -1,5 +1,10 @@
<head>
<link href="https://gmpg.org/xfn/11" rel="profile">
+ {{ if .Params.canonicalUrl }}
+ <link rel="canonical" href="{{ .Params.canonicalUrl }}">
+ {{ else }}
+ <link rel="canonical" href="{{ .Permalink }}">
+ {{ end }}
{{ partial "header/meta.html" . }}
{{ partial "header/styles.html" . }}
{{ `<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->