Only add html[dir] attr if languageDirection is explicitly set
This commit is contained in:
parent
19242fd2f8
commit
c49009b823
|
@ -1,5 +1,5 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="{{ $.Site.LanguageCode | default "en" }}" {{ partial "language-direction.html" . | safeHTMLAttr }}>
|
<html lang="{{ site.LanguageCode | default "en" }}" {{- with partialCached "func/GetLanguageDirection" "GetLanguageDirection" }} dir="{{ . }}" {{- end }}>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||||
|
|
7
layouts/partials/func/GetLanguageDirection.html
Normal file
7
layouts/partials/func/GetLanguageDirection.html
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
{{ $dir := "" }}
|
||||||
|
{{ if ge hugo.Version "0.67.1" }}
|
||||||
|
{{ with site.Language.LanguageDirection }}
|
||||||
|
{{ $dir = . }}
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
|
{{ return $dir }}
|
|
@ -1,3 +0,0 @@
|
||||||
{{- if ge hugo.Version "0.67.1" -}}
|
|
||||||
dir="{{ $.Site.Language.LanguageDirection | default "ltr" }}"
|
|
||||||
{{- end -}}
|
|
Loading…
Reference in a new issue