1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- {{ $item := .item }}
- {{/* Dynamic view adjusts to content type. */}}
- {{ $show_authors_only := false }}{{/* Show authors only or full metadata? */}}
- {{ $link := $item.RelPermalink }}
- {{ $target := "" }}
- {{ if $item.Params.external_link }}
- {{ $link = $item.Params.external_link }}
- {{ $target = "target=\"_blank\" rel=\"noopener\"" }}
- {{ end }}
- {{ if eq $item.Type "event" }}
- {{ $show_authors_only = true }}
- {{ else if eq $item.Type "publication" }}
- {{ $show_authors_only = true }}
- {{ else if eq $item.Type "project" }}
- {{ $show_authors_only = true }}
- {{ end }}
- {{ $has_attachments := partial "functions/has_attachments" . }}
- {{/* Get summary. */}}
- {{ $summary := "" }}
- {{ if $item.Params.summary }}
- {{ $summary = $item.Params.summary | markdownify | emojify }}
- {{ else if .Params.abstract }}
- {{ $summary = .Params.abstract | markdownify | emojify | truncate (site.Params.abstract_length | default 135) }}
- {{ else if $item.Summary }}
- {{ $summary = $item.Summary }}
- {{ end }}
- <div class="media stream-item view-compact">
- <div class="media-body">
- <div class="section-subheading article-title mb-0 mt-0">
- <a href="{{$link}}" {{ $target | safeHTMLAttr }}>{{ $item.Title }}</a>
- </div>
- {{ with $summary }}
- <a href="{{ $link }}" {{ $target | safeHTMLAttr }} class="summary-link">
- <div class="article-style">
- {{.}}
- </div>
- </a>
- {{ end }}
- <div class="stream-meta article-metadata">
- {{ if eq $item.Type "event" }}
- <div>
- <span>
- {{ partial "functions/get_event_dates" $item }}
- </span>
- {{ with $item.Params.location }}
- <span class="middot-divider"></span>
- <span>{{ . }}</span>
- {{ end }}
- </div>
- {{ end }}
- {{ if and $show_authors_only $item.Params.authors }}
- <div>
- {{ partial "page_metadata_authors" $item }}
- </div>
- {{ else if not $show_authors_only }}
- {{ partial "page_metadata" (dict "page" $item "is_list" 1) }}
- {{ end }}
- </div>
- {{ if $has_attachments }}
- <div class="btn-links">
- {{ partial "page_links" (dict "page" $item "is_list" 1) }}
- </div>
- {{ end }}
- </div>
- <div class="ml-3">
- {{ $resource := ($item.Resources.ByType "image").GetMatch "*featured*" }}
- {{ with $resource }}
- {{ $image := .Resize "150x webp" }}
- <a href="{{$link}}" {{ $target | safeHTMLAttr }}>
- <img src="{{ $image.RelPermalink }}" height="{{ $image.Height }}" width="{{ $image.Width }}"
- alt="{{ $item.Title }}" loading="lazy">
- </a>
- {{end}}
- </div>
- </div>
|