forked from CCCHH/hacker.tours-website
Replace homepage event lists with responsive logo cards
Include all existing events in both languages and add homepage-only logo credits. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
parent
5487a6437b
commit
872a4883d1
1 changed files with 378 additions and 52 deletions
29
layouts/shortcodes/event-cards.html
Normal file
29
layouts/shortcodes/event-cards.html
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
<section class="event-list" aria-labelledby="event-list-title">
|
||||
<h1 id="event-list-title">{{ .Page.Params.eventsTitle }}</h1>
|
||||
<div class="event-cards">
|
||||
{{ range .Page.Params.events }}
|
||||
<article class="event-card{{ with .status }} event-card--upcoming{{ end }}">
|
||||
<header class="event-card__header">
|
||||
<h2>{{ .code }}</h2>
|
||||
{{ $logo := resources.GetMatch (printf "img/events/%s.*" (lower .code)) }}
|
||||
{{ $original := .logoOriginal }}
|
||||
{{ with $logo }}
|
||||
{{ if $original }}
|
||||
<img class="event-card__image" src="{{ .RelPermalink }}" alt="">
|
||||
{{ else }}
|
||||
<span class="event-card__logo" style="--event-logo: url('{{ .RelPermalink }}')" aria-hidden="true"></span>
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
{{ errorf "Missing event logo for %s" .code }}
|
||||
{{ end }}
|
||||
</header>
|
||||
<div class="event-card__body">
|
||||
<h3>{{ if .status }}{{ .title }}{{ else }}<a href="{{ .url }}">{{ .title }}</a>{{ end }}</h3>
|
||||
<p>{{ .event }}</p>
|
||||
<p class="event-card__date">{{ .date }}, {{ .location }}</p>
|
||||
{{ with .status }}<p class="event-card__status">{{ . }}</p>{{ end }}
|
||||
</div>
|
||||
</article>
|
||||
{{ end }}
|
||||
</div>
|
||||
</section>
|
||||
Loading…
Reference in a new issue