Files
jcoffey-dev d90fdc9d0b
ci / go (pull_request) Successful in 54s
ci / editor-ui (pull_request) Successful in 1m19s
Five more packs: faq, gallery, location-and-hours, team, testimonials
The first batch of WordPress add-ons rebuilt as packs: templates and styles only, no script.

- faq: questions that open to show their answers (<details>), written in the section or shared from data/.
- gallery: a picture grid; each opens full size with previous and next, using #links and :target, no script.
- location-and-hours: address with an OpenStreetMap link, phone, email, opening hours and a note, from data/location.yaml, as a section or a partial for any layout.
- team: a people collection with a page per person (photo, role, email, links), a list page and a Team section.
- testimonials: quotes with a name and a role.

Also: sections get .Index, their place on the page, so two galleries on a page don't share ids; pack templates may use tel: links; docs/packs.md lists the bundled packs. A new test installs each into the starter with real content, builds it, and runs the checks expecting no errors.
2026-10-11 17:11:40 -07:00

32 lines
1.3 KiB
HTML

{{/* 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 }}
<link rel="stylesheet" href="{{ asset "packs/faq/faq.css" }}">
<section class="block faq">
<div class="wrap">
{{ with .Data.heading }}<h2>{{ . }}</h2>{{ end }}
{{ with .Data.intro }}<div class="intro">{{ markdownify . }}</div>{{ end }}
<div class="faq-list">
{{ range $i, $q := $items }}
<details class="faq-item"{{ if and $.Data.open (eq $i 0) }} open{{ end }}>
<summary>{{ $q.question }}</summary>
<div class="faq-answer">{{ markdownify $q.answer }}</div>
</details>
{{ end }}
</div>
</div>
</section>