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.
15 lines
994 B
HTML
15 lines
994 B
HTML
{{ define "main" }}
|
|
<link rel="stylesheet" href="{{ asset "packs/directory/directory.css" }}">
|
|
<section class="wrap page directory">
|
|
<h1>{{ .Title }}</h1>
|
|
{{ with .Content }}<div class="prose">{{ . }}</div>{{ end }}
|
|
{{ $all := sortBy "category" (sortBy "Title" (collection .Collection)) }}
|
|
{{ $cats := list }}{{ $last := "<none>" }}{{ range $all }}{{ $c := default "Other" .Params.category }}{{ if ne (print $c) $last }}{{ $cats = append $cats $c }}{{ $last = print $c }}{{ end }}{{ end }}
|
|
{{ if gt (len $cats) 1 }}<nav class="dir-cats" aria-label="Categories"><ul>{{ range $cats }}<li><a href="#{{ slugify . }}">{{ . }}</a></li>{{ end }}</ul></nav>{{ end }}
|
|
{{ range $cats }}{{ $cat := print . }}
|
|
<h2 class="dir-cat" id="{{ slugify $cat }}">{{ $cat }}</h2>
|
|
<ul class="dir-list">{{ range $all }}{{ if eq (print (default "Other" .Params.category)) $cat }}{{ template "listing-card" . }}{{ end }}{{ end }}</ul>
|
|
{{ else }}<p>Nothing listed yet.</p>{{ end }}
|
|
</section>
|
|
{{ end }}
|