64 lines
2.7 KiB
HTML
64 lines
2.7 KiB
HTML
{{/*
|
|
One pull quote (`text`, `cite`), or a stack of them (`items`, each with
|
|
`text` and `cite`). With `cards: true`, items render as a two-column grid
|
|
of short testimonials: `text`, `name`, optional `role` (Markdown, for a
|
|
linked company) and `photo`; without a photo, the person's initials show.
|
|
`savings` adds a compact savings calculator below: `apps` (names) and
|
|
`selected` (names ticked to start) are looked up in the `savings` section
|
|
of the page at `from`, so prices live in one place; `headline` and `more`
|
|
(label + url of the full calculator) are optional.
|
|
*/}}
|
|
{{ $s := . }}
|
|
{{ partial "sections/head.html" $s }}
|
|
{{ $items := $s.items | default (slice (dict "text" $s.text "cite" $s.cite)) }}
|
|
{{ if $s.cards }}
|
|
<ul class="said-cards">
|
|
{{ range $items }}
|
|
<li class="said-card">
|
|
<blockquote>{{ .text | markdownify }}</blockquote>
|
|
<div class="said-who">
|
|
{{ with .photo }}
|
|
<img class="said-photo" src="{{ . | relURL }}" alt="" width="44" height="44" loading="lazy">
|
|
{{ else }}
|
|
{{ $initials := "" }}{{ range first 2 (split .name " ") }}{{ $initials = printf "%s%s" $initials (substr . 0 1) }}{{ end }}
|
|
<span class="said-photo said-initials" aria-hidden="true">{{ $initials }}</span>
|
|
{{ end }}
|
|
<span class="said-id">
|
|
<span class="said-name">{{ .name }}</span>
|
|
{{ with .role }}<span class="said-role">{{ . | markdownify }}</span>{{ end }}
|
|
</span>
|
|
</div>
|
|
</li>
|
|
{{ end }}
|
|
</ul>
|
|
{{ else }}
|
|
<div class="said-list">
|
|
{{ range $items }}
|
|
<figure class="said">
|
|
<blockquote>{{ .text | markdownify }}</blockquote>
|
|
{{ with .cite }}<figcaption>{{ . | markdownify }}</figcaption>{{ end }}
|
|
</figure>
|
|
{{ end }}
|
|
</div>
|
|
{{ end }}
|
|
{{ with $s.savings }}
|
|
{{ $cfg := . }}
|
|
{{ with site.GetPage $cfg.from }}
|
|
{{ $src := dict }}
|
|
{{ range .Params.sections }}{{ if eq .type "savings" }}{{ $src = . }}{{ end }}{{ end }}
|
|
{{ $apps := slice }}
|
|
{{ range $name := $cfg.apps }}
|
|
{{ range $src.apps }}{{ if eq .name $name }}
|
|
{{ $apps = $apps | append (dict "name" .name "cost" .cost "perSeat" .perSeat "selected" (in ($cfg.selected | default slice) $name)) }}
|
|
{{ end }}{{ end }}
|
|
{{ end }}
|
|
<div class="said-savings">
|
|
{{ with $cfg.headline }}<h3 class="said-savings-title">{{ . }}</h3>{{ end }}
|
|
{{ partial "savings-calc.html" (dict "key" (printf "%s-savings" (partial "section-id.html" $s)) "apps" $apps "annual" $src.federatedAnnual "compact" true "more" $cfg.more) }}
|
|
</div>
|
|
{{ else }}
|
|
{{ errorf "quote section: savings.from page %q not found" $cfg.from }}
|
|
{{ end }}
|
|
{{ end }}
|
|
{{ if $s.ctas }}<div class="cta-row mt-2">{{ partial "sections/ctas.html" $s.ctas }}</div>{{ end }}
|