blob: c67a5dad8cd23e52520eb12ce5c46532845a9c60 (
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
66
67
68
|
<article class="post" itemscope itemtype="http://schema.org/Article">
{{- $publish_date := .PublishDate.Format (.Site.Params.dateFormatToUse | default "2006-01-02") -}}
{{- $author := .Params.author | default .Site.Author.name -}}
{{- $author_link := .Params.author_link | default .Site.Author.link | default .Site.BaseURL -}}
<!--featured_image-->
{{- with .Params.featured_image -}}
{{- $image := $.Params.featured_image_preview | default . -}}
<div class="post-featured-image-preview">
{{- $res := resources.Get "svg/loading.svg" | minify -}}
<img src="{{ $res.RelPermalink }}" data-sizes="auto" data-src="{{ $image }}" alt="featured image" class="lazyload">
</div>
{{- end -}}
<!-- end featured_image-->
<h1 class="post-title post-list-title" itemprop="name headline">
<a href="{{ .Permalink }}">{{ .Title }}</a>
</h1>
<div class="post-meta">
<a class="author" href="{{ $author_link }}" rel="author" target="_blank">
<i class="fas fa-user-circle fa-fw"></i>{{ $author }}
</a>
{{ T "publish" }} <time datetime={{ $publish_date }}>{{ $publish_date }}</time>
{{- with .Params.categories -}}
<span class="post-category">
{{- T "included" -}}
{{- range . -}}
{{- $name := . -}}
{{- with $.Site.GetPage "taxonomy" (printf "categories/%s" $name) | default ($.Site.GetPage "taxonomy" (printf "categories/%s" ($name | urlize))) -}}
<i class="far fa-folder fa-fw"></i>
<a href="{{ .Permalink }}">{{ $name }}</a>
{{- end -}}
{{- end -}}
</span>
{{- end -}}
</div>
<div class="post-content">
{{- if .Params.show_description -}}
<p>
{{- .Params.description -}}
</p>
{{- else -}}
{{- $summary := .Summary -}}
{{- $REin := `:\(([\w- ]+?)\):` -}}
{{- $REout := `<i class="$1 fa-fw"></i>` -}}
{{- $summary = replaceRE $REin $REout $summary -}}
{{- $REin = `\[(.+?)\]\^\((.+?)\)` -}}
{{- $REout = `<strong><ruby>$1<rt>$2</rt></ruby></strong>` -}}
{{- $summary = replaceRE $REin $REout $summary -}}
{{- $summary | safeHTML -}}
{{- end -}}
</div>
<div class="post-footer">
<a href="{{ .Permalink }}">{{ T "readMore" }}</a>
{{- with .Params.tags -}}
<div class="post-tags">
{{- range . -}}
<span class="tag">
<a href="{{ "tags/" | absURL }}{{ . | urlize }}/"><i class="fas fa-tag fa-fw"></i> {{ . }}</a>
</span>
{{- end -}}
</div>
{{- end -}}
</div>
</article>
|