hugo-theme-zzo/layouts/_default/summary.html

67 lines
2.3 KiB
HTML
Raw Normal View History

2019-11-12 03:10:27 +00:00
{{ if eq (lower .Site.Params.summaryShape) "card" }}
<article class="summary-card">
2019-11-04 13:09:44 +00:00
<header>
<h5 class="title h5"><a href='{{ .Permalink }}'> {{ .Title }}</a> </h5>
2019-11-12 03:10:27 +00:00
<h6 class="subtitle caption">🕓 {{ .Date.Format (i18n "summary-dateformat") }} · ☕{{ .ReadingTime }} min read</h6>
2019-11-04 13:09:44 +00:00
</header>
{{ $params := .Params }}
2019-11-12 03:10:27 +00:00
<div class="summary-card__content">
<div class="summary-card__text p2">
{{ with $params.Description }}
2019-11-04 13:09:44 +00:00
{{ . }}
{{ else }}
{{ .Summary }}
{{ end }}
</div>
2019-11-12 03:10:27 +00:00
{{ if $params.featured_image }}
<div class="summary-card__image-wrapper">
{{ with (print "images/" $params.featured_image) }}
<img data-src="{{ . | relURL }}" alt="{{ print $params.featured_image }}" class="lazyload summary-card__image">
{{ end }}
</div>
{{ else if $params.featured_video }}
{{ with print ("videos/poster/" | relURL) $params.featured_video_poster }}
<div class="summary-card__video-wrapper">
<video class="summary-card__video" controls preload='none' poster='{{ . | relURL }}' data-setup='{"fluid": true}'>
{{ with print ("videos/" | relURL) $params.featured_video }}
<source src="{{ . | relURL }}" type='video/mp4'>
2019-11-04 13:09:44 +00:00
{{ end }}
2019-11-12 03:10:27 +00:00
</video>
</div>
{{ end }}
{{ end }}
</div>
<hr />
</article>
{{ else if eq (lower .Site.Params.summaryShape) "classic" }}
<article class="summary-classic">
<div class="summary-classic__flex-box">
{{ $params := .Params }}
{{ if $params.featured_image }}
<div class="summary-classic__image-wrapper">
{{ with (print "images/" $params.featured_image) }}
<img data-src="{{ . | relURL }}" alt="{{ print $params.featured_image }}" class="lazyload summary-classic__image">
{{ end }}
</div>
{{ end }}
<div class="summary-classic__content">
<header>
<h5 class="title h5"><a href='{{ .Permalink }}'> {{ .Title }}</a> </h5>
<h6 class="subtitle caption">🕓 {{ .Date.Format (i18n "summary-dateformat") }} · ☕{{ .ReadingTime }} min read
</h6>
</header>
<div>
<div class="summary-classic__text p2">
{{ with $params.Description }}
{{ . }}
{{ else }}
{{ .Summary }}
2019-11-04 13:09:44 +00:00
{{ end }}
2019-11-12 03:10:27 +00:00
</div>
2019-11-04 13:09:44 +00:00
</div>
2019-11-12 03:10:27 +00:00
</div>
2019-11-04 13:09:44 +00:00
</div>
2019-11-12 03:10:27 +00:00
<hr />
</article>
{{ else }}
{{ end }}