mirror of
https://github.com/gcushen/hugo-academic.git
synced 2025-07-26 19:15:16 +02:00
feat: add support for Portfolio's Showcase view in all normal, non-portfolio views
This commit is contained in:
parent
a99a1efa45
commit
1e48b12bf8
1 changed files with 61 additions and 0 deletions
61
wowchemy/layouts/partials/views/showcase.html
Normal file
61
wowchemy/layouts/partials/views/showcase.html
Normal file
|
@ -0,0 +1,61 @@
|
|||
{{ $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 := .link }}
|
||||
{{ $target := .target }}
|
||||
|
||||
{{/* Get summary. */}}
|
||||
{{ $summary := "" }}
|
||||
{{ if $item.Params.summary }}
|
||||
{{ $summary = $item.Params.summary | markdownify | emojify }}
|
||||
{{ else if .Params.abstract }}
|
||||
{{ $summary = .Params.abstract | markdownify | emojify }}
|
||||
{{ else if $item.Summary }}
|
||||
{{ $summary = $item.Summary }}
|
||||
{{ end }}
|
||||
|
||||
{{ $order := "" }}
|
||||
{{ if and ($widget.Params.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>
|
||||
|
||||
{{ 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 := ($item.Resources.ByType "image").GetMatch "*featured*" }}
|
||||
{{ with $resource }}
|
||||
{{ $image := .Resize "540x" }}
|
||||
{{if $do_link}}<a href="{{ $link }}" {{ $target | safeHTMLAttr }}>{{end}}
|
||||
<img src="{{ $image.RelPermalink }}" alt="{{ $item.Title }}" loading="lazy">
|
||||
{{if $do_link}}</a>{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
Loading…
Add table
Add a link
Reference in a new issue