1
0
mirror of https://github.com/alanorth/hugo-theme-bootstrap4-blog.git synced 2024-11-24 13:10:18 +01:00

layouts: Set dir="auto" on some HTML elements

When a site is rendered in Arabic the root HTML element gets the
dir="rtl" attribute, but even Arabic sites might have an English
title or footer, etc so we should set dir="auto" on those elements.
This commit is contained in:
Alan Orth 2019-04-18 23:38:53 +03:00
parent 2db85d8ab6
commit 9934368215
Signed by: alanorth
GPG Key ID: 0FB860CC9C45B1B9
2 changed files with 4 additions and 4 deletions

View File

@ -55,8 +55,8 @@
{{ if (ne .Site.Params.header_visible false) }} {{ if (ne .Site.Params.header_visible false) }}
<header class="blog-header"> <header class="blog-header">
<div class="container"> <div class="container">
<h1 class="blog-title"><a href="{{ .Site.BaseURL }}" rel="home">{{ .Site.Title | safeHTML }}</a></h1> <h1 class="blog-title" dir="auto"><a href="{{ .Site.BaseURL }}" rel="home">{{ .Site.Title | safeHTML }}</a></h1>
{{ if .Site.Params.description }}<p class="lead blog-description">{{ .Site.Params.description | markdownify }}</p>{{ end }} {{ if .Site.Params.description }}<p class="lead blog-description" dir="auto">{{ .Site.Params.description | markdownify }}</p>{{ end }}
</div> </div>
</header> </header>
{{ end }} {{ end }}
@ -81,7 +81,7 @@
{{ block "footer" . }} {{ block "footer" . }}
<footer class="blog-footer"> <footer class="blog-footer">
<p> <p dir="auto">
{{ if .Site.Copyright }} {{ if .Site.Copyright }}
{{ .Site.Copyright | markdownify }} {{ .Site.Copyright | markdownify }}
{{ else }} {{ else }}

View File

@ -2,7 +2,7 @@
{{ if and (.Site.Params.sidebar) (isset .Site.Params.sidebar "about") }} {{ if and (.Site.Params.sidebar) (isset .Site.Params.sidebar "about") }}
<section class="sidebar-module sidebar-module-inset"> <section class="sidebar-module sidebar-module-inset">
<h4>{{ i18n "about" }}</h4> <h4>{{ i18n "about" }}</h4>
<p>{{ .Site.Params.sidebar.about | markdownify }}</p> <p dir="auto">{{ .Site.Params.sidebar.about | markdownify }}</p>
</section> </section>
{{ end }} {{ end }}