blob: 1092d3fda6a042f1c8abdead663999d48b6b9f3d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
{{ if and (eq .Type "video") (not .Site.Config.Privacy.YouTube.Disable) }}
<div class="video-container">
{{ if .Scratch.Get "fullsize" }}
<iframe src="https://www.youtube-nocookie.com/embed/{{ .Params.youtube }}?rel=0" width="100%" height="600px" frameborder="0" allowfullscreen></iframe>
{{ else }}
<iframe src="https://www.youtube-nocookie.com/embed/{{ .Params.youtube }}?rel=0" width="100%" height="200px" frameborder="0" allowfullscreen></iframe>
{{ end }}
</div>
{{ else if eq .Type "audio" }}
<div class="video-container">
<iframe src="https://open.spotify.com/embed?uri={{ .Params.spotify }}" width="100%" height="80" frameborder="0" allowtransparency="true"></iframe>
</div>
{{ else }}
{{- $images := $.Resources.ByType "image" -}}
{{- $featured := $images.GetMatch "*feature*" -}}
{{- $featured := cond (ne $featured nil) $featured ($images.GetMatch "{*cover*,*thumbnail*}") -}}
{{- $featured := cond (ne $.Params.featured_image nil) (.Page.Resources.GetMatch (printf "*%s" $.Params.featured_image)) $featured -}}
{{ $sitetitle := (.Title) }}
{{ $fullsize := .Scratch.Get "fullsize" }}
{{- with $featured -}}
<div class="card-image">
{{ if $fullsize }}
{{ $thumb := .Resize "1108x" }}
<img src="{{ $thumb.RelPermalink }}" alt="{{ $sitetitle }}" title="{{ $sitetitle }}">
{{ else }}
{{ $thumb := .Resize "360x" }}
<img src="{{ $thumb.RelPermalink }}" alt="{{ $sitetitle }}" title="{{ $sitetitle }}">
{{ end }}
</div>
{{ end }}
{{ end }}
|