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.
0800aa7 parent: efbeb67 modified
blog/layouts/_default/baseof.html +5 -0 | @@ -149,6 +149,11 @@ | ||
| 149 | 149 | {{ with $desc -}} |
| 150 | 150 | <meta name="description" content="{{ . }}"> |
| 151 | 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 | 157 | {{- $pageImage := partial "page-image.html" . }} |
| 153 | 158 | {{ partial "opengraph.html" (dict "page" . "desc" $desc "image" $pageImage) }} |
| 154 | 159 | |
| @@ -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 | ||