Skip to content

Commit

Permalink
Update showcase with publication date
Browse files Browse the repository at this point in the history
  • Loading branch information
gianpaolopalma committed Jul 19, 2024
1 parent d86ad5f commit 000277e
Showing 1 changed file with 74 additions and 0 deletions.
74 changes: 74 additions & 0 deletions layouts/partials/views/showcase.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{{ $item := .item }}
{{ $widget := .page }}
{{ $index := .index }}

{{ $do_link := true }}
{{ if $item.Params.external_link | or $item.Content }}
{{ $do_link = true }}
{{ else }}
{{ $do_link = false }}
{{ end }}

{{ $link := $item.Params.external_link | default $item.RelPermalink }}
{{ $target := .target }}

{{/* Get summary. */}}
{{ $summary := "" }}
{{ if $item.Params.summary }}
{{ $summary = $item.Params.summary | markdownify | emojify }}
{{ else if $item.Params.abstract }}
{{ $summary = $item.Params.abstract | markdownify | emojify }}
{{ else if $item.Summary }}
{{ $summary = $item.Summary }}
{{ end }}

{{ $order := "" }}
{{ if isset $widget "Params" }}
{{ if and ($widget.Params.design.flip_alt_rows | default true) (not (modBool $index 2)) }}
{{ $order = "order-md-2" }}
{{ end }}
{{ else if and ($widget.design.flip_alt_rows | default true) (not (modBool $index 2)) }}
{{ $order = "order-md-2" }}
{{ end }}


<div class="col-lg-12 mb-5 view-showcase">
<div class="row align-items-center">
<div class="col-12 col-md-6">
<div class="section-subheading article-title mb-0 mt-0">
{{- if $do_link}}<a href="{{ $link }}" {{ $target | safeHTMLAttr }}>{{end -}}
{{ $item.Title | markdownify | emojify }}
{{- if $do_link}}</a>{{end -}}
</div>

<div class="publ-date">
{{ partial "functions/get_event_dates" $item }}
</div>

{{ with $summary }}
<div class="article-style">
{{ . }}
</div>
{{ end }}

<div class="btn-links">
{{ partial "page_links" (dict "page" $item "is_list" 0) }}
</div>

</div>
<div class="col-12 col-md-6 order-first {{$order}}">
{{ $resource := partial "blox-core/functions/get_featured_image.html" $item }}

{{ with $resource }}
{{/* Use CSS to expand images to consistent widths rather than just Hugo as Hugo can significantly increase the
filesize of GIFs when processing them, e.g. 400kB --> 1.5MB */}}
{{ $image := . }}
{{ if ne $image.MediaType.SubType "gif" }}{{ $image = $image.Process "resize 540x webp" }}{{ end }}
{{if $do_link}}<a href="{{ $link }}" {{ $target | safeHTMLAttr }}>{{end}}
<img src="{{ $image.RelPermalink }}" height="{{ $image.Height }}" width="{{ $image.Width }}"
alt="{{ $item.Title }}" loading="lazy" style="width: 540px; height: auto; object-fit: cover;">
{{if $do_link}}</a>{{end}}
{{end}}
</div>
</div>
</div>

0 comments on commit 000277e

Please sign in to comment.