mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
tpl/tplimpl: Use .Language.LanguageCode in built-in templates
This commit is contained in:
parent
9cdca1f958
commit
ff77a927f9
3 changed files with 5 additions and 5 deletions
|
@ -16,8 +16,8 @@
|
||||||
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title>
|
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title>
|
||||||
<link>{{ .Permalink }}</link>
|
<link>{{ .Permalink }}</link>
|
||||||
<description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}</description>
|
<description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}</description>
|
||||||
<generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }}
|
<generator>Hugo -- gohugo.io</generator>
|
||||||
<language>{{.}}</language>{{end}}{{ with .Site.Author.email }}
|
<language>{{ site.Language.LanguageCode }}</language>{{ with .Site.Author.email }}
|
||||||
<managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }}
|
<managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }}
|
||||||
<webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }}
|
<webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }}
|
||||||
<copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }}
|
<copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }}
|
||||||
|
|
|
@ -10,12 +10,12 @@
|
||||||
<priority>{{ .Sitemap.Priority }}</priority>{{ end }}{{ if .IsTranslated }}{{ range .Translations }}
|
<priority>{{ .Sitemap.Priority }}</priority>{{ end }}{{ if .IsTranslated }}{{ range .Translations }}
|
||||||
<xhtml:link
|
<xhtml:link
|
||||||
rel="alternate"
|
rel="alternate"
|
||||||
hreflang="{{ .Language.Lang }}"
|
hreflang="{{ .Language.LanguageCode }}"
|
||||||
href="{{ .Permalink }}"
|
href="{{ .Permalink }}"
|
||||||
/>{{ end }}
|
/>{{ end }}
|
||||||
<xhtml:link
|
<xhtml:link
|
||||||
rel="alternate"
|
rel="alternate"
|
||||||
hreflang="{{ .Language.Lang }}"
|
hreflang="{{ .Language.LanguageCode }}"
|
||||||
href="{{ .Permalink }}"
|
href="{{ .Permalink }}"
|
||||||
/>{{ end }}
|
/>{{ end }}
|
||||||
</url>
|
</url>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html{{ with site.LanguageCode | default site.Language.Lang }} lang="{{ . }}"{{ end }}>
|
<html lang="{{ site.Language.LanguageCode }}">
|
||||||
<head>
|
<head>
|
||||||
<title>{{ .Permalink }}</title>
|
<title>{{ .Permalink }}</title>
|
||||||
<link rel="canonical" href="{{ .Permalink }}">
|
<link rel="canonical" href="{{ .Permalink }}">
|
||||||
|
|
Loading…
Reference in a new issue