mykiwi/mykiwi.blogpublic Fork
⑂ 0800aa7
Commits
⬇ Clone ▾
git clone https://git.rickub.com/mykiwi/mykiwi.blog.git
git clone ssh://git@rickub.com/mykiwi/mykiwi.blog.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Download ZIP

Name each page's own URL as its canonical one

Self-referencing, not pointed at one "main" language: every language build
already states how it relates to the others through the hreflang loop just
below, so this only tells a search engine which URL to treat as definitive
for this copy - itself. Without it, the same post reached with a query
string or a trailing-slash variation is free to be indexed as a separate
page.
Romain Gautier committed 2026-09-23T22:58:48+02:00 Browse files
0800aa7 parent: efbeb67
modified blog/layouts/_default/baseof.html +5 -0
@@ -149,6 +149,11 @@
149149 {{ with $desc -}}
150150 <meta name="description" content="{{ . }}">
151151 {{- end }}
152+ {{- /* Self-referencing, not pointed at one "main" language: each
153+ language build already says how it relates to the others via the
154+ hreflang loop below, so this just states what search engines should
155+ treat as the definitive URL for *this* copy - itself. */}}
156+ <link rel="canonical" href="{{ .Permalink }}">
152157 {{- $pageImage := partial "page-image.html" . }}
153158 {{ partial "opengraph.html" (dict "page" . "desc" $desc "image" $pageImage) }}
154159
@@ -149,6 +149,11 @@
149 {{ with $desc -}}149 {{ with $desc -}}
150 <meta name="description" content="{{ . }}">150 <meta name="description" content="{{ . }}">
151 {{- end }}151 {{- end }}
152+ {{- /* Self-referencing, not pointed at one "main" language: each
153+ language build already says how it relates to the others via the
154+ hreflang loop below, so this just states what search engines should
155+ treat as the definitive URL for *this* copy - itself. */}}
156+ <link rel="canonical" href="{{ .Permalink }}">
152 {{- $pageImage := partial "page-image.html" . }}157 {{- $pageImage := partial "page-image.html" . }}
153 {{ partial "opengraph.html" (dict "page" . "desc" $desc "image" $pageImage) }}158 {{ partial "opengraph.html" (dict "page" . "desc" $desc "image" $pageImage) }}
154 159