Files
jcoffey-dev 56d6dbbfc3
ci / editor-ui (pull_request) Successful in 31s
ci / go (pull_request) Successful in 2m11s
Nine packs: the rest of the list
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.
2026-10-14 13:40:50 -07:00

33 lines
2.3 KiB
HTML

{{/* section
label: Status
about: Whether each service is working, the overall picture, and recent incidents.
fields:
- { name: heading, type: text }
- { name: from, type: data, default: status, label: Status from, help: The file in data/ with your components. }
- { name: collection, type: collection, default: incidents, label: Incidents from }
- { name: count, type: number, default: 5, label: Recent incidents to show }
*/}}
{{ $d := data (default "status" .Data.from) }}{{ $c := default "incidents" .Data.collection }}
{{ $down := false }}{{ $part := false }}{{ $maint := false }}
{{ range $d.components }}{{ $s := print .status }}{{ if eq $s "outage" }}{{ $down = true }}{{ else if eq $s "degraded" }}{{ $part = true }}{{ else if eq $s "maintenance" }}{{ $maint = true }}{{ end }}{{ end }}
{{ $open := list }}{{ $past := list }}{{ range collection $c }}{{ if eq (print .Params.status) "resolved" }}{{ $past = append $past . }}{{ else }}{{ $open = append $open . }}{{ end }}{{ end }}
<link rel="stylesheet" href="{{ asset "packs/status-page/status-page.css" }}">
<section class="block status">
<div class="wrap">
{{ with .Data.heading }}<h2>{{ . }}</h2>{{ end }}
<p class="st-overall {{ if $down }}st-outage{{ else if or $part $open }}st-degraded{{ else if $maint }}st-maintenance{{ else }}st-operational{{ end }}">{{ if $down }}Something is down.{{ else if or $part $open }}Some things aren't working as they should.{{ else if $maint }}Maintenance is under way.{{ else }}Everything is working.{{ end }} <small>As of {{ date "January 2, 2006, 3:04 PM" now }}.</small></p>
{{ with $open }}
<h3 class="st-h">Now</h3>
<ul class="st-incidents">{{ range . }}{{ template "incident-row" . }}{{ end }}</ul>
{{ end }}
<ul class="st-components">
{{ range $d.components }}<li><span class="st-name">{{ .name }}{{ with .note }}<small>{{ . }}</small>{{ end }}</span><span class="st-badge st-{{ default "operational" .status }}">{{ template "status-label" (default "operational" .status) }}</span></li>{{ end }}
</ul>
{{ with $past }}
<h3 class="st-h">Past incidents</h3>
<ul class="st-incidents">{{ range limit (default 5 $.Data.count) . }}{{ template "incident-row" . }}{{ end }}</ul>
{{ end }}
<p class="st-more"><a href="/{{ $c }}/">Every incident</a> · <a href="/{{ $c }}/feed.xml">Follow in a feed reader</a></p>
</div>
</section>