ccchh-website/themes/ccchh/layouts/shortcodes/calendar-table.html
bitwhisker 90c1e00005
Some checks failed
/ build (pull_request) Successful in 42s
/ cleanup-staging (pull_request) Failing after 2s
show canceled calendar events as canceld on home page
2026-06-01 20:00:39 +02:00

31 lines
1.3 KiB
HTML

{{- index .Site.Data "calendar.json" }}
<table>
<thead>
<tr>
<td>Datum</td>
<td>Titel</td>
<td>Ort</td>
</tr>
</thead>
<tbody>
{{- range first 7 (sort $.Site.Data.calendar "dtstart" ) }}
{{- if eq ._type "vevent"}}
<tr>
{{- $start := time .dtstart }}
<td style="font-variant-numeric: tabular-nums;">{{- if eq .status "CANCELLED" }}<del>{{- end }}{{ time.Format "Mon, 2006-01-02 15:04" $start.Local }}{{- if eq .status "CANCELLED" }}</del>{{- end }}</td>
{{- $potentialUrl := index (findRE `https?://\S*` .description 1) 0 }}
{{- if eq $potentialUrl nil }}
<td>{{- if eq .status "CANCELLED" }}<del>{{- end }}{{ .summary }}{{- if eq .status "CANCELLED" }}</del>{{- end }}</td>
{{- else }}
<td><a href="{{ $potentialUrl }}">{{- if eq .status "CANCELLED" }}<del>{{- end }}{{ .summary }}{{- if eq .status "CANCELLED" }}</del>{{- end }}</a></td>
{{- end }}
{{- if eq .location "Z9" }}
<td><a href="https://wiki.hamburg.ccc.de/club:z9:start">{{- if eq .status "CANCELLED" }}<del>{{- end }}Z9{{- if eq .status "CANCELLED" }}</del>{{- end }}</a></td>
{{- else }}
<td>{{- if eq .status "CANCELLED" }}<del>{{- end }}{{ .location }}{{- if eq .status "CANCELLED" }}</del>{{- end }}</td>
{{- end }}
</tr>
{{- end }}
{{- end }}
</tbody>
</table>