game_tile.html 794 Bytes
Newer Older
Tobias Bengfort's avatar
Tobias Bengfort committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<a href="{{ .RelPermalink }}" class="card bg-inverse h-100">
  <h2 class="card-header">{{ .Title }}</h2>

  {{ $banner := .Resources.GetMatch "banner.*" }}
  {{ $thumbnail := $banner.Resize "400x" }}

  {{ if .Params.featured }}
    {{ $bannerWide := .Resources.GetMatch "banner-wide.*" }}
    {{ if $bannerWide }}
      {{ $thumbnail = $bannerWide.Resize "1200x" }}
    {{ else }}
      {{ $thumbnail = $banner.Fill "1200x400" }}
    {{ end }}
  {{ end }}

Tobias Bengfort's avatar
Tobias Bengfort committed
16
  <img src="{{ $thumbnail.RelPermalink }}" alt="{{ $banner.Title }}" class="card-img flex-grow-1 img-cover">
Tobias Bengfort's avatar
Tobias Bengfort committed
17
18

  {{ if isset .Params "category" }}
19
    <span class="badge bg-{{ if eq .Params.category "full game" }}brand{{ else if eq .Params.category "jam" }}inverse{{ else }}body{{ end }}">#{{ .Params.category }}</span>
Tobias Bengfort's avatar
Tobias Bengfort committed
20
21
  {{ end }}
</a>