mirror of
https://github.com/alanorth/hugo-theme-bootstrap4-blog.git
synced 2025-05-07 21:16:00 +02:00
Add right-to-left version of CSS
This uses rtlcss to make a right-to-left version of the CSS and then utilizes Hugo's Language variable to conditionally include it. Also, we set the "dir" attribute on the HTML tag if the currently rendered language is Arabic.
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ .Lang }}">
|
||||
<html lang="{{ .Lang }}" {{ if eq .Lang "ar" }}dir="rtl"{{ end }}>
|
||||
|
||||
<head>
|
||||
{{ partial "head-meta.html" . }}
|
||||
@ -12,8 +12,13 @@
|
||||
|
||||
<title>{{ block "title" . }}{{ .Site.Title }}{{ end }}</title>
|
||||
|
||||
{{ if eq .Lang "ar" }}
|
||||
{{ "<!-- ar -->" | safeHTML }}
|
||||
<link href="{{ .Site.BaseURL }}css/style.rtl.css" rel="stylesheet"{{ if not .Site.Params.disable_sri }} integrity="{{ .Site.Data.sri.styleltr}}" crossorigin="anonymous"{{ end }}>
|
||||
{{ else }}
|
||||
{{ "<!-- combined, minified CSS -->" | safeHTML }}
|
||||
<link href="{{ .Site.BaseURL }}css/style.css" rel="stylesheet"{{ if not .Site.Params.disable_sri }} integrity="{{ .Site.Data.sri.style}}" crossorigin="anonymous"{{ end }}>
|
||||
{{ end }}
|
||||
|
||||
{{ "<!-- RSS 2.0 feed -->" | safeHTML }}
|
||||
{{ with .OutputFormats.Get "rss" -}}
|
||||
|
Reference in New Issue
Block a user