Attempt a shortcode for the schedule overview
All checks were successful
/ build (pull_request) Successful in 25s
All checks were successful
/ build (pull_request) Successful in 25s
This commit is contained in:
parent
eaad6eb7b2
commit
c0dfc9131d
24 changed files with 570 additions and 148 deletions
|
|
@ -1,16 +1 @@
|
|||
{{- $code := .Get 0 | lower -}}
|
||||
{{- $validCodes := slice "de" "en" "deen" -}}
|
||||
{{- if not (in $validCodes $code) -}}
|
||||
<span style="color: red; font-weight: bold;">Warning: Invalid or missing language code '{{ $code }}'. Use 'de', 'en', or 'deen'.</span>
|
||||
{{- else -}}
|
||||
{{- $label := cond (eq $code "de") "DE" (cond (eq $code "en") "EN" (cond (eq $code "deen") "DE/EN" "")) -}}
|
||||
{{- $title := "" -}}
|
||||
{{- if eq $code "deen" -}}
|
||||
{{- $title = cond (eq .Site.Language.Name "de") "Diese Tour wird zweisprachig stattfinden (Deutsch und Englisch)" "This tour will be bilingual (German and English)" -}}
|
||||
{{- else if eq $code "de" -}}
|
||||
{{- $title = cond (eq .Site.Language.Name "de") "Diese Tour wird auf Deutsch stattfinden" "This tour will be held in German" -}}
|
||||
{{- else if eq $code "en" -}}
|
||||
{{- $title = cond (eq .Site.Language.Name "de") "Diese Tour wird auf Englisch stattfinden" "This tour will be held in English" -}}
|
||||
{{- end -}}
|
||||
<abbr style="font-size: .65em; vertical-align: super;" title="{{ $title }}">{{ $label }}</abbr>
|
||||
{{- end -}}
|
||||
{{- partial "lang-badge.html" (dict "code" (.Get 0)) -}}
|
||||
|
|
|
|||
Loading…
Reference in a new issue