Files
HugoBlox-kit/wowchemy/layouts/partials/li_list.html
T
George Cushen d4ecdca0eb feat: show button links in listings irrespective of Type
For example, if a blog post has an attachment, it will now be linked in the listing as well as in its page header.

May also reduce excess spacing by preventing empty attachment DIV in the case of no attachments/buttons since it now checks if a page has buttons.
2021-01-16 20:24:05 +00:00

56 lines
1.5 KiB
HTML

{{ $item := . }}
{{/* Dynamic view adjusts to content type. */}}
{{ $icon_pack := "far" }}
{{ $icon := "fa-file-alt" }}
{{ $show_authors := false }}
{{ $link := $item.RelPermalink }}
{{ $target := "" }}
{{ if $item.Params.external_link }}
{{ $link = $item.Params.external_link }}
{{ $target = "target=\"_blank\" rel=\"noopener\"" }}
{{ end }}
{{ if eq $item.Type "post" }}
{{ $icon = "fa-newspaper" }}
{{ else if eq $item.Type "event" }}
{{ $icon = "fa-calendar-alt" }}
{{ else if eq $item.Type "publication" }}
{{ $show_authors = true }}
{{ else if eq $item.Type "project" }}
{{ $icon_pack = "fas" }}
{{ $icon = "fa-project-diagram" }}
{{ $show_authors = true }}
{{ end }}
{{ $has_attachments := partial "functions/has_attachments" . }}
<div class="view-list-item">
<i class="{{$icon_pack}} {{$icon}} pub-icon" aria-hidden="true"></i>
<a href="{{$link}}" {{ $target | safeHTMLAttr }}>{{ $item.Title }}</a>
{{ if eq $item.Type "event" }}
<div class="article-metadata">
<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 $item.Params.authors }}
<div class="article-metadata">
{{ partial "page_metadata_authors" $item }}
</div>
{{ end }}
{{ if $has_attachments }}
<div class="btn-links">
{{ partial "page_links" (dict "page" $item "is_list" 1) }}
</div>
{{ end }}
</div>