summaryrefslogtreecommitdiffstats
path: root/layouts
diff options
context:
space:
mode:
authorSerghei Iakovlev <egrep@protonmail.ch>2022-04-27 00:08:33 +0200
committerSerghei Iakovlev <egrep@protonmail.ch>2022-04-27 00:08:33 +0200
commitd356641e2b45db0f87f64956ff91240edadf0a97 (patch)
treefa92db35674ece56b3cc0f3f9cef52d39cb12ade /layouts
parent38ccf62df5666b067fe63fa9dfd262fdef012706 (diff)
downloadgohugo-theme-ed-d356641e2b45db0f87f64956ff91240edadf0a97.tar.gz
Define GetLanguageDirection function
Diffstat (limited to 'layouts')
-rw-r--r--layouts/_default/baseof.html2
-rw-r--r--layouts/partials/func/GetLanguageDirection.html5
-rw-r--r--layouts/partials/head.html7
3 files changed, 7 insertions, 7 deletions
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
index e555192..b33c566 100644
--- a/layouts/_default/baseof.html
+++ b/layouts/_default/baseof.html
@@ -1,5 +1,5 @@
<!DOCTYPE html>
-<html lang="{{ site.LanguageCode | default site.Language.Lang }}" dir="{{ site.Language.LanguageDirection | default "ltr" }}">
+<html lang="{{ site.LanguageCode | default site.Language.Lang }}" {{- with partialCached "func/GetLanguageDirection" "GetLanguageDirection" }} dir="{{ . }}" {{- end }}>
{{- partial "head.html" . -}}
<body class="theme-base-{{ .Site.Params.color_scheme }}">
<!-- This if statement decides which sidebar to use -->
diff --git a/layouts/partials/func/GetLanguageDirection.html b/layouts/partials/func/GetLanguageDirection.html
new file mode 100644
index 0000000..fe107a8
--- /dev/null
+++ b/layouts/partials/func/GetLanguageDirection.html
@@ -0,0 +1,5 @@
+{{ $dir := "" }}
+{{ with site.Language.LanguageDirection }}
+ {{ $dir = . }}
+{{ end }}
+{{ return $dir }}
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index 71a2a8c..51ec8e3 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -6,15 +6,10 @@
{{- $author := print .Site.Author.name -}}
{{- if .Params.author -}}{{ $author = .Params.author }}{{- end -}}
- <!-- Basic meta elements -->
<meta charset="utf-8">
-
- <!-- Enable responsiveness on mobile devices -->
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1.0,shrink-to-fit=no">
-
- <!-- Canonical link to help search engines -->
<link rel="canonical" href="{{ .Permalink }}">
-
<title>{{ block "title" . }}{{ with .Params.Title }}{{ . }} - {{ end }}{{ .Site.Title }}{{ end }}</title>
<meta name="description" content="{{ $description }}">
{{ hugo.Generator }}