{{/* section label: Questions and answers about: Questions that open to show their answers, for an FAQ or a help page. fields: - { name: heading, type: text, default: Questions and answers } - { name: intro, type: markdown } - name: items type: list label: Questions fields: - { name: question, type: text, required: true } - { name: answer, type: markdown, required: true } - { name: from, type: data, label: Questions from, help: A file in data/ that holds the questions, to share them between pages. Leave empty to use the questions above. } - { name: open, type: bool, label: Show the first answer open } */}} {{ $items := .Data.items }}{{ with .Data.from }}{{ $items = data . }}{{ end }}
{{ with .Data.heading }}

{{ . }}

{{ end }} {{ with .Data.intro }}
{{ markdownify . }}
{{ end }}
{{ range $i, $q := $items }}
{{ $q.question }}
{{ markdownify $q.answer }}
{{ end }}