The second batch of WordPress add-ons rebuilt as packs, templates and styles only:
- docs: a documentation section with a sidebar, part pages and previous/next, in the order data/docs-nav.yaml gives (the layout behind hotdogcms.org/docs, without its search script).
- downloads: files to download, with their type and size read from the file at build time.
- menu-and-prices: a price list in groups (a menu, services) and plans side by side.
- portfolio: a work collection with a cover, details and pictures per project, a list page and a section.
- share-links: plain links to Mastodon, Bluesky, LinkedIn and email share pages; nothing loads from those sites until someone chooses one.
Also a fileSize template function ("1.2 MB" for a file in static/, "" if it isn't there). The bundled-packs test covers all ten.
20 lines
847 B
HTML
20 lines
847 B
HTML
{{/* section
|
|
label: Portfolio
|
|
about: The latest projects, with their cover pictures.
|
|
fields:
|
|
- { name: heading, type: text, default: Our work }
|
|
- { name: intro, type: markdown }
|
|
- { name: collection, type: collection, default: work, label: Projects from }
|
|
- { name: count, type: number, default: 6, label: How many }
|
|
*/}}
|
|
{{ $c := default "work" .Data.collection }}
|
|
<link rel="stylesheet" href="{{ asset "packs/portfolio/portfolio.css" }}">
|
|
<section class="block portfolio">
|
|
<div class="wrap">
|
|
{{ with .Data.heading }}<h2>{{ . }}</h2>{{ end }}
|
|
{{ with .Data.intro }}<div class="intro">{{ markdownify . }}</div>{{ end }}
|
|
<ul class="pf-grid">{{ range limit (default 6 .Data.count) (collection $c) }}{{ template "project-card" . }}{{ end }}</ul>
|
|
<p><a class="more" href="/{{ $c }}/">All our work</a></p>
|
|
</div>
|
|
</section>
|