mirror of
https://github.com/nunocoracao/blowfish.git
synced 2026-11-07 03:29:20 +00:00
✨ Add hreflang alternates to multilingual page head
This commit is contained in:
1 parent
b0c563bc15
commit
7ea30cb4f1
1 file changed
+8
@@ -30,6 +30,14 @@
|
|||||||
<meta name="robots" content="{{ . }}">
|
<meta name="robots" content="{{ . }}">
|
||||||
{{ end }}
|
{{ end }}
|
||||||
<link rel="canonical" href="{{ .Permalink }}">
|
<link rel="canonical" href="{{ .Permalink }}">
|
||||||
|
{{ if .IsTranslated }}
|
||||||
|
{{ range .AllTranslations }}
|
||||||
|
{{ $hreflang := .Language.LanguageCode | default .Language.Lang }}
|
||||||
|
{{ if $hreflang }}
|
||||||
|
<link rel="alternate" hreflang="{{ $hreflang }}" href="{{ .Permalink }}">
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
{{ range .AlternativeOutputFormats }}
|
{{ range .AlternativeOutputFormats }}
|
||||||
{{ printf `
|
{{ printf `
|
||||||
<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .RelPermalink ($.Site.Title | emojify) |
|
<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .RelPermalink ($.Site.Title | emojify) |
|
||||||
|
|||||||
Reference in new issue
Block a user