mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 07:47:54 +00:00
i18n: support for languageDirection #733
This commit is contained in:
parent
42b604b4fb
commit
9227dfd41f
6 changed files with 6 additions and 5 deletions
|
@ -124,6 +124,7 @@ title = "Hugo Relearn Theme"
|
|||
title = "Cap'n Hugo Relearrrn Theme"
|
||||
weight = 2
|
||||
languageCode = "art-pir"
|
||||
languageDirection = "rtl"
|
||||
languageName = "Arrr! ☠ Pirrrates ☠"
|
||||
# Language dependend settings:
|
||||
# Use case https://gohugo.io/content-management/multilingual/#translation-by-content-directory
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[Reading-direction]
|
||||
other = "rtl"
|
||||
other = "ltr"
|
||||
|
||||
[Search]
|
||||
other = "Searrrch"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<!DOCTYPE html>
|
||||
{{- partialCached "page-meta.hugo" . .RelPermalink }}
|
||||
{{- $outputFormat := partial "output-format.hugo" . }}
|
||||
<html lang="{{ .Page.Language.LanguageCode | default "en" }}" dir="{{ T "Reading-direction" | default "ltr" }}">
|
||||
<html lang="{{ .Page.Language.LanguageCode | default "en" }}" dir="{{ .Page.Language.LanguageDirection | default (T "Reading-direction") | default "ltr" }}">
|
||||
<head>
|
||||
{{- partial "meta.html" . }}
|
||||
{{- $title := .Title }}
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
{{- errorf "The Relearn theme requires Hugo %s or later" $hugoVersion }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
<html lang="{{ .Page.Language.LanguageCode | default "en" }}" dir="{{ T "Reading-direction" | default "ltr" }}">
|
||||
<html lang="{{ .Page.Language.LanguageCode | default "en" }}" dir="{{ .Page.Language.LanguageDirection | default (T "Reading-direction") | default "ltr" }}">
|
||||
<head>
|
||||
{{- partial "meta.html" . }}
|
||||
{{- $page := . }}
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
{{- $showPrevNext := (and (not .Params.disableNextPrev) (not .Site.Params.disableNextPrev)) }}
|
||||
{{- if and (or (eq $outputFormat "html") (eq $outputFormat "searchpage")) $showPrevNext }}
|
||||
{{- $endarrow := "🡒" }}
|
||||
{{- if eq (T "Reading-direction" | default "ltr") "rtl" }}
|
||||
{{- if eq (.Language.LanguageDirection | default (T "Reading-direction") | default "ltr") "rtl" }}
|
||||
{{- $endarrow = "🡐" }}
|
||||
{{- end }}
|
||||
{{- $next := "" }}
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
{{- $showPrevNext := (and (not .Params.disableNextPrev) (not .Site.Params.disableNextPrev)) }}
|
||||
{{- if and (or (eq $outputFormat "html") (eq $outputFormat "searchpage")) $showPrevNext }}
|
||||
{{- $startarrow := "🡐" }}
|
||||
{{- if eq (T "Reading-direction" | default "ltr") "rtl" }}
|
||||
{{- if eq (.Language.LanguageDirection | default (T "Reading-direction") | default "ltr") "rtl" }}
|
||||
{{- $startarrow = "🡒" }}
|
||||
{{- end }}
|
||||
{{- $prev := "" }}
|
||||
|
|
Loading…
Reference in a new issue