reviews (star ratings with the average, as a section or under a product, which then gets AggregateRating), glossary (A to Z with a letter row, each term linkable, DefinedTermSet), logo-wall (a still grid, muted logos become light outlines in dark mode, white tiles on request), videos (a library from your own files: page per video with captions and transcript, list, feed, Latest videos section, VideoObject), directory (entries grouped by category with a page each), link-in-bio (one page of big buttons, no menu), status-page (components from data/status.yaml, incidents with a feed), coming-soon (a holding page with a launch date and a form, no menu) and timeline (dates down a line). Template functions: sortBy, ratings and stars. formatDate takes a date with a time, as front matter's date: does, and now is in the site's timezone. A layout can leave out the site's menu by redefining nav, but only with a non-empty body: Go keeps the old template when the new one is empty.
29 lines
1.3 KiB
HTML
29 lines
1.3 KiB
HTML
{{/* section
|
|
label: Reviews
|
|
about: Star ratings from customers, with the average and how many.
|
|
fields:
|
|
- { name: heading, type: text, default: What customers say }
|
|
- { name: intro, type: markdown }
|
|
- name: items
|
|
type: list
|
|
label: Reviews
|
|
fields:
|
|
- { name: name, type: text, required: true }
|
|
- { name: rating, type: number, required: true, help: 1 to 5. }
|
|
- { name: text, type: markdown, label: What they said }
|
|
- { name: date, type: text, help: "When, such as 2026-09-14." }
|
|
- { name: source, type: text, help: "Where it was posted, such as Google." }
|
|
- { name: from, type: data, label: Reviews from, help: A file in data/ that holds the reviews, to share them between pages. Leave empty to use the reviews above. }
|
|
- { name: no_summary, type: bool, label: Hide the average }
|
|
*/}}
|
|
{{ $items := .Data.items }}{{ with .Data.from }}{{ $items = data . }}{{ end }}
|
|
<link rel="stylesheet" href="{{ asset "packs/reviews/reviews.css" }}">
|
|
<section class="block reviews">
|
|
<div class="wrap">
|
|
{{ with .Data.heading }}<h2>{{ . }}</h2>{{ end }}
|
|
{{ with .Data.intro }}<div class="intro">{{ markdownify . }}</div>{{ end }}
|
|
{{ if not .Data.no_summary }}{{ template "review-summary" $items }}{{ end }}
|
|
<ul class="rv-list">{{ range $items }}{{ template "review-item" . }}{{ end }}</ul>
|
|
</div>
|
|
</section>
|