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

40 lines
1.5 KiB
HTML
Raw Normal View History

2019-11-04 13:09:44 +00:00
<article class="summary">
<header>
<h4 class="title h5"><a href='{{ .Permalink }}'> {{ .Title }}</a> </h2>
<h6 class="subtitle caption">🕓 {{ .Date.Format (i18n "summary-dateformat") }} · ☕{{ .ReadingTime }} min read</h6>
</header>
<!-- <img src="blog/post-1/1.png"/> -->
{{ $params := .Params }}
<div class="summary__content">
<div class="summary__text p2">
{{ with $params.Desc }}
{{ . }}
{{ else }}
{{ .Summary }}
{{ end }}
</div>
{{ if $params.featured_image }}
<div class="summary__image-wrapper">
{{ with (print "/images/" $params.featured_image) }}
2019-11-05 08:22:56 +00:00
<img data-src="{{ . | relURL }}" alt="{{ print $params.featured_image }}" class="lazyload summary__image">
2019-11-04 13:09:44 +00:00
{{ end }}
</div>
{{ else if $params.featured_video }}
{{ with (print "/videos/poster/" $params.featured_video_poster) }}
<div class="video">
2019-11-05 08:22:56 +00:00
<video class='video-js' controls preload='none' poster='{{ . | relURL }}' data-setup='{"fluid": true}'>
2019-11-04 13:09:44 +00:00
{{ with (print "/videos/" $params.featured_video) }}
2019-11-05 08:22:56 +00:00
<source src="{{ . | relURL }}" type='video/mp4'>
2019-11-04 13:09:44 +00:00
{{ end }}
<p class='vjs-no-js'>
To view this video please enable JavaScript, and consider upgrading to a web browser that
<a href='https://videojs.com/html5-video-support/' target='_blank' rel="noopener">supports HTML5 video</a>
</p>
</video>
</div>
{{ end }}
{{ end }}
</div>
<hr/>
</article>