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.
32 lines
1.3 KiB
HTML
32 lines
1.3 KiB
HTML
{{/* section
|
|
label: Testimonials
|
|
about: Quotes from people you work with, each with a name and a role.
|
|
fields:
|
|
- { name: heading, type: text, default: What people say }
|
|
- { name: intro, type: markdown }
|
|
- name: items
|
|
type: list
|
|
label: Quotes
|
|
fields:
|
|
- { name: quote, type: textarea, required: true }
|
|
- { name: name, type: text, required: true, help: As the person agreed to be named. }
|
|
- { name: role, type: text, help: "Their role, or where they're from: Customer since 2019, Owner of The Corner Shop." }
|
|
- { name: from, type: data, label: Quotes from, help: A file in data/ that holds the quotes, to share them between pages. Leave empty to use the quotes above. }
|
|
*/}}
|
|
{{ $items := .Data.items }}{{ with .Data.from }}{{ $items = data . }}{{ end }}
|
|
<link rel="stylesheet" href="{{ asset "packs/testimonials/testimonials.css" }}">
|
|
<section class="block testimonials">
|
|
<div class="wrap">
|
|
{{ with .Data.heading }}<h2>{{ . }}</h2>{{ end }}
|
|
{{ with .Data.intro }}<div class="intro">{{ markdownify . }}</div>{{ end }}
|
|
<div class="tm-list">
|
|
{{ range $items }}
|
|
<figure class="tm-item">
|
|
<blockquote>{{ .quote }}</blockquote>
|
|
<figcaption><strong>{{ .name }}</strong>{{ with .role }}<span>{{ . }}</span>{{ end }}</figcaption>
|
|
</figure>
|
|
{{ end }}
|
|
</div>
|
|
</div>
|
|
</section>
|