culinary.kemonine.info/themes/hugo-cuisine-book/layouts/partials/box.html
2022-12-03 10:27:03 -05:00

51 lines
1.6 KiB
HTML

{{ $baseUrl := .Site.BaseURL }}
<a class="box" href="{{ .Permalink }}" aria-label="{{ .Title }}">
<div class="columns is-flex is-vcentered">
<div class="column is-one-quarter">
{{ if .Params.featured_image }}
<figure class="is-flex image is-1by1">
{{ with .Resources.GetMatch .Params.featured_image }}
<img alt="{{ .Name }}" class="is-rounded" src="{{ .RelPermalink }}" />
{{ else }}
<img
alt="{{ .Params.featured_image }}"
class="is-rounded"
src="{{ .Params.featured_image | relURL }}"
/>
{{ end }}
</figure>
{{ end }}
</div>
<div class="column">
<div>{{ .Title }}</div>
{{ if .GitInfo }} {{ with .GitInfo.AuthorName }}
<small><p class="has-text-info">{{ . }}</p></small>
{{ end }} {{ end }}
<span>
{{ $rating := 0 }} {{ if and (isset .Params "rating") (le .Params.rating
5) }} {{ $rating = .Params.rating }} {{ end }} {{ range $i := (seq
$rating) }}
<i class="fas fa-star has-text-warning"></i>
{{ end }} {{ range $i := (seq (sub 5 $rating)) }}
<i class="fas fa-star"></i>
{{ end }}
</span>
</div>
</div>
<div class="columns is-flex">
<div class="column">
{{ if .Params.description }}
<small class="has-text-grey">{{ .Params.description }}</small>
{{ end }}
<small class="has-text-grey">{{ .Summary }}</small>
</div>
</div>
<div class="columns is-flex">
<div class="column">
{{ range .Params.Tags }}
<span class="tag is-primary is-light">{{ . }}</span>
{{ end }}
</div>
</div>
</a>