Implement simple shortcode to fetch data from 'data/values.yaml'
parent
e4bd4855b5
commit
c2822d06d5
|
@ -17,19 +17,19 @@ aliases:
|
|||
|
||||
### Empfänger
|
||||
|
||||
> `dezentrale e.V.`
|
||||
> `{{< value "account" "recepient" >}}`
|
||||
|
||||
### Institut
|
||||
|
||||
> `Sparkasse Leipzig`
|
||||
> `{{< value "account" "institution" >}}`
|
||||
|
||||
### IBAN
|
||||
|
||||
> `DE48 8605 5592 1090 1699 29`
|
||||
> `{{< value "account" "iban" >}}`
|
||||
|
||||
### BIC
|
||||
|
||||
> `WELADE8L`
|
||||
> `{{< value "account" "bic" >}}`
|
||||
|
||||
|
||||
Für Spenden oder Mitgliedsbeiträge stellen wir gerne eine steuerabzugsfähige
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
account:
|
||||
recepient: dezentrale e.V.
|
||||
institution: Sparkasse Leipzig
|
||||
iban: DE48 8605 5592 1090 1699 29
|
||||
bic: WELADE8L
|
|
@ -0,0 +1,13 @@
|
|||
{{- $section := default (.Get 0) (.Get "section") -}}
|
||||
{{- $key := default (.Get 1) (.Get "key") -}}
|
||||
{{- $value := index $.Site.Data.values $section $key -}}
|
||||
{{- if not $section }}
|
||||
{{- errorf "missing parameter 'section': %s" .Position }}
|
||||
{{- end }}
|
||||
{{- if not $key }}
|
||||
{{- errorf "missing parameter 'key': %s" .Position }}
|
||||
{{- end }}
|
||||
{{- if not $value }}
|
||||
{{- errorf "missing, empty or null value at 'values/%s.%s': %s" $section $key .Position }}
|
||||
{{- end }}
|
||||
{{- $value -}}
|
Loading…
Reference in New Issue