blob: d8807442b999e1012962475017adce7c9f33483c (
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
{{ if .Site.Params.thumbnailImage }}
{{ if .Params.thumbnailimage }}
{{ .Scratch.Set "thumbnailImage" (.Params.thumbnailimage | absURL) }}
{{ else }}
{{ if or .Params.autothumbnailimage (and .Site.Params.autoThumbnailImage (ne .Params.autothumbnailimage false)) }}
{{ if .Params.gallery }}
{{ range first 1 .Params.gallery }}
{{ range first 1 (split . " ") }}
{{ $.Scratch.Set "thumbnailImage" (. | absURL) }}
{{ end }}
{{ end }}
{{ else }}
{{ if .Params.coverimage }}
{{ .Scratch.Set "thumbnailImage" (.Params.coverimage | absURL) }}
{{ end }}
{{ end }}
{{ end }}
{{ end }}
{{ end }}
{{ if or .Params.thumbnailimageposition .Site.Params.thumbnailimageposition }}
{{ .Scratch.Set "thumbnailImagePosition" (.Params.thumbnailimageposition | default .Site.Params.thumbnailimageposition) }}
{{ else }}
{{ .Scratch.Set "thumbnailImagePosition" "bottom" }}
{{ end }}
<article class="postShorten postShorten--thumbnailimg-{{ .Scratch.Get "thumbnailImagePosition" }}" itemscope itemType="http://schema.org/BlogPosting">
<div class="postShorten-wrap">
{{ if and (.Scratch.Get "thumbnailImage") (eq (.Scratch.Get "thumbnailImagePosition") "top")}}
<a href="{{ .Permalink }}">
<div class="postShorten-thumbnailimg">
<img alt="" itemprop="image" src="{{ .Scratch.Get "thumbnailImage" }}"/>
</div>
</a>
{{ end }}
<div class="postShorten-header">
<h1 class="postShorten-title" itemprop="headline">
<a class="link-unstyled" href="{{ .Permalink }}">
{{ .Title }}
</a>
</h1>
{{ partial "post/meta" . }}
</div>
<div class="postShorten-excerpt" itemprop="articleBody">
{{ if .Params.Summary }}
{{ .Params.Summary | markdownify }}
{{ else }}
{{ .Summary }}
{{ end }}
<p>
<a href="{{ .Permalink }}" class="postShorten-excerpt_link link">{{ i18n "post.read_more" }}</a>
{{ with .Params.readingtime }}
<span class="postShorten-readingtime">
{{ printf " - %s min read" . }}
</span>
{{ end }}
</p>
</div>
</div>
{{ if and (.Scratch.Get "thumbnailImage") (ne (.Scratch.Get "thumbnailImagePosition") "top")}}
<a href="{{ .Permalink }}">
<div class="postShorten-thumbnailimg">
<img alt="" itemprop="image" src="{{ .Scratch.Get "thumbnailImage" }}"/>
</div>
</a>
{{ end }}
</article>
|