ccchh-website/themes/ccchh/layouts/shortcodes/calendar-table.html

32 lines
888 B
HTML
Raw Normal View History

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