|
| 1 | +{{ $item := .item }} |
| 2 | + |
| 3 | +{{/* Dynamic view adjusts to content type. */}} |
| 4 | +{{ $has_attachments := partial "functions/has_attachments" $item }} |
| 5 | + |
| 6 | +{{ $link := $item.RelPermalink }} |
| 7 | +{{ $target := "" }} |
| 8 | +{{ if $item.Params.external_link }} |
| 9 | + {{ $link = $item.Params.external_link }} |
| 10 | + {{ $target = "target=\"_blank\" rel=\"noopener\"" }} |
| 11 | +{{ end }} |
| 12 | + |
| 13 | +{{/* Get summary. */}} |
| 14 | +{{ $summary := "" }} |
| 15 | +{{ if $item.Params.summary }} |
| 16 | + {{ $summary = $item.Params.summary | markdownify | emojify }} |
| 17 | +{{ else if $item.Params.abstract }} |
| 18 | + {{ $summary = $item.Params.abstract | markdownify | emojify }} |
| 19 | +{{ else if $item.Summary }} |
| 20 | + {{ $summary = $item.Summary }} |
| 21 | +{{ end }} |
| 22 | + |
| 23 | +<div class="card-simple view-card"> |
| 24 | + |
| 25 | + {{ if eq $item.Type "event" }} |
| 26 | + <div class="article-metadata"> |
| 27 | + {{ if $item.Params.authors }} |
| 28 | + <div> |
| 29 | + {{ partial "page_metadata_authors" $item }} |
| 30 | + </div> |
| 31 | + {{ end }} |
| 32 | + <span> |
| 33 | + {{ partial "functions/get_event_dates" $item }} |
| 34 | + </span> |
| 35 | + {{ with $item.Params.location }} |
| 36 | + <span class="middot-divider"></span> |
| 37 | + <span>{{ . }}</span> |
| 38 | + {{ end }} |
| 39 | + </div> |
| 40 | + {{ else }} |
| 41 | + {{ partial "page_metadata" (dict "page" $item "is_list" 1) }} |
| 42 | + {{ end }} |
| 43 | + |
| 44 | + {{ $resource := partial "blox-core/functions/get_featured_image.html" $item }} |
| 45 | + {{ $anchor := $item.Params.image.focal_point | default "Smart" }} |
| 46 | + {{ with $resource }} |
| 47 | + {{ $image := .Fill (printf "1600x900 %s" $anchor) }} |
| 48 | + {{ if ne $image.MediaType.SubType "gif" }}{{ $image = $image.Process "webp" }}{{ end }} |
| 49 | + <a href="{{ $link }}" {{ $target | safeHTMLAttr }}> |
| 50 | + <div class="img-hover-zoom"> |
| 51 | + <img src="{{ $image.RelPermalink }}" height="{{ $image.Height }}" width="{{ $image.Width }}" |
| 52 | + class="article-banner" alt="{{ $item.Title }}" loading="lazy"> |
| 53 | + </div> |
| 54 | + </a> |
| 55 | + {{end}} |
| 56 | + |
| 57 | + <div class="section-subheading article-title mb-1 mt-3"> |
| 58 | + <a href="{{ $link }}" {{ $target | safeHTMLAttr }}>{{ $item.Title }}</a> |
| 59 | + </div> |
| 60 | + |
| 61 | + {{ with $summary }} |
| 62 | + <a href="{{ $link }}" {{ $target | safeHTMLAttr }} class="summary-link"> |
| 63 | + <div class="article-style"> |
| 64 | + <p>{{.}}</p> |
| 65 | + </div> |
| 66 | + </a> |
| 67 | + {{ end }} |
| 68 | + |
| 69 | + {{ if $has_attachments }} |
| 70 | + <div class="btn-links"> |
| 71 | + {{ partial "page_links" (dict "page" $item "is_list" 1) }} |
| 72 | + </div> |
| 73 | + {{ end }} |
| 74 | + |
| 75 | +</div> |
0 commit comments