hugo-theme-zzo/layouts/partials/showcase/show-pinned.html

40 lines
1.3 KiB
HTML
Raw Normal View History

<div>
{{ $pinnedNum := 0 }}
{{ range .Pages }}
{{ $pinnedNum = add $pinnedNum (len (where .Pages "Params.pinned" true)) }}
{{ end }}
{{ if gt $pinnedNum 0 }}
2020-01-21 06:03:02 +00:00
<div style="display: flex; justify-content: center">
<ol class="showcase__box--wrapper">
{{ range .Pages }}
{{ $category := .Params.category }}
{{ range where .Pages "Params.pinned" true }}
2020-01-21 06:03:02 +00:00
<li class="showcase__box">
<a href="{{ .Params.Link }}" class="showcase__box--link" target="_blank" rel="noreferrer"></a>
<span class="showcase__box--title">
{{ .Title }}
</span>
<div class="showcase__box--desc">
{{ .Description }}
</div>
<div class="grow"></div>
<div class="showcase__box--meta">
<span class="type">
{{ partial "svgs/etc/code.svg" (dict "width" 14 "height" 14) }}
{{ $category }}
</span>
<div class="grow"></div>
<a href="{{ .Params.Repo }}" class="type" target="_blank" rel="noreferrer">
{{ partial "svgs/social/github.svg" (dict "width" 14 "height" 14) }}
Repository
</a>
</div>
2020-01-21 06:03:02 +00:00
</li>
{{ end }}
{{ end }}
2020-01-21 06:03:02 +00:00
</ol>
</div>
{{ end }}
</div>