pages/layouts/_default/list.html

92 lines
2.8 KiB
HTML
Raw Normal View History

{{ define "main" }}
2023-02-25 05:13:45 +00:00
{{ partial "scrolling-image-header" . }}
2024-11-23 02:37:42 +00:00
<section>
<div>
2023-02-25 05:13:45 +00:00
{{ block "content" . }}
{{ .Content }}
{{ end }}
</div>
2024-11-23 02:37:42 +00:00
{{ range .Pages }}
<div class="card">
{{ partial "category-button" . }}
2024-11-23 02:37:42 +00:00
{{ with .Param "fa-thumbnail" }}
<div class="card-header">
<div class="thumb-icon-wrapper">
<span class="thumb-icon-badge">
<i class="fa-fw {{ . }}"></i>
</span>
</div>
</div>
{{ end }}
2024-11-23 02:37:42 +00:00
{{/* Thumbnail images should be stored as 'thumbnail'.* in the page bundle, but
historically they might have been referenced as 'thumbnail' in the front
matter, or (even more historically) as 'cardImage'. Use scratch to
normalize all these different systems.
*/}}
{{ $bundleGlob := "thumbnail.*" }}
{{ $frontThumbGlob := print "images/" (.Params.thumbnail) ".*" }}
{{ $frontCardGlob := print "images/" (.Params.cardImage) ".jpg" }}
{{ $allThumbnailGlob := print "{" $frontThumbGlob "," $frontCardGlob "," $bundleGlob "}" }}
{{ with .Resources.GetMatch $allThumbnailGlob }}
{{ $thumbnail := . }}
{{ $thumbnailResized := $thumbnail.Resize "600x" }}
2023-04-01 06:15:16 +00:00
2024-11-23 02:37:42 +00:00
<div class="card-header">
<img
class="img-thumbnail"
src="{{ $thumbnailResized.RelPermalink }}"
alt="Thumbnail of {{ .Title }}"
/>
</div>
{{ end }}
2023-04-01 06:40:52 +00:00
2023-04-01 06:15:16 +00:00
2024-11-23 02:37:42 +00:00
<div class="card-body">
{{/* Prefer full-text links over local ones */}}
<div class="card-title">
{{ $link := default .RelPermalink (index .Params "link") }}
<a href="{{ $link }}"><h3>{{ .Title }}</h3></a>
</div>
2023-04-01 06:15:16 +00:00
2024-11-23 02:37:42 +00:00
<div>
{{ dateFormat "02 Jan 2006" .Date }}
</div>
2023-04-01 06:31:42 +00:00
2024-11-23 02:37:42 +00:00
{{ range (.GetTerms "people") }}
<a
href="{{ .RelPermalink }}"
class="card-link {{ if eq .LinkTitle "Thomas A. Christensen II" }}
fw-bolder
{{ end }}"
><i class="fad fa-user"></i> {{ .LinkTitle }}</a
>
{{ end }}
<p class="card-text">
{{ .Summary }}
<strong
><small
><a href="{{ $link }}">Read&nbsp;more&nbsp;&raquo;</a></small
></strong
>
</p>
<div class="card-footer">
{{ range (.GetTerms "tags") }}
<a href="{{ .RelPermalink }}" class="icon-link card-link"
><i class="fad fa-tag"></i> {{ .LinkTitle }}</a
>
{{ end }}
</div>
</div>
2024-11-23 02:37:42 +00:00
</div>
<!-- </card> -->
{{ end }}
2023-02-25 05:13:45 +00:00
</section>
{{ end }}