mirror of
https://github.com/nunocoracao/blowfish.git
synced 2026-10-25 21:22:57 +00:00
Merge pull request #2874 from aplgr/feat/hreflang-head-alternates
Add hreflang alternates to multilingual page head
This commit is contained in:
1 file changed
+8
@@ -30,6 +30,14 @@
|
||||
<meta name="robots" content="{{ . }}">
|
||||
{{ end }}
|
||||
<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 }}
|
||||
{{ printf `
|
||||
<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .RelPermalink ($.Site.Title | emojify) |
|
||||
|
||||
Reference in new issue
Block a user