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

github.com/peaceiris/hugo-theme-iris.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/partials/head/general.html')
-rw-r--r--layouts/partials/head/general.html5
1 files changed, 3 insertions, 2 deletions
diff --git a/layouts/partials/head/general.html b/layouts/partials/head/general.html
index 13907b8a..c6511c52 100644
--- a/layouts/partials/head/general.html
+++ b/layouts/partials/head/general.html
@@ -57,6 +57,7 @@
<!-- Open Graph Protocol (OGP) -->
{{ partial "head/ogp" . }}
-{{ with .Page.Params.canonicalURL }}
-<link rel="canonical" href="{{ . | safeURL }}">
+{{ $canonicalURL := urls.Parse $.Page.Params.canonicalURL }}
+{{ if $canonicalURL.Host }}
+<link rel="canonical" href="{{ $.Page.Params.canonicalURL | safeURL }}">
{{ end }}