Improve and document how to set language direction, i.e ltr/rtl.

This commit is contained in:
Fredrik Jonsson 2019-11-28 10:34:46 +01:00
commit 7b634ad79c
2 changed files with 8 additions and 1 deletions

View file

@ -276,6 +276,8 @@ A language selector will be included on sites with more than one language. Add `
The language selector will link to a translation of the current page if it exist and to the front page if it does not. The language selector will link to a translation of the current page if it exist and to the front page if it does not.
For "rtl" languages add a `dir` parameter to the language configuration. If not added it will default to "ltr".
``` ```
languages: languages:
sv: sv:
@ -284,6 +286,11 @@ languages:
en: en:
weight: 2 weight: 2
languageName: "English" languageName: "English"
ar:
weight: 3
languageName: "العربية"
params:
dir: "rtl"
``` ```

View file

@ -1,5 +1,5 @@
<!DOCTYPE html> <!DOCTYPE html>
<html class="nojs" lang="{{ .Site.Language.Lang }}" dir="{{ $.Param "languagedir" | default "ltr" }}"> <html class="nojs" lang="{{ .Site.Language.Lang }}" dir="{{ .Site.Language.Params.dir | default "ltr" }}">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width"> <meta name="viewport" content="width=device-width">