LoveIt/layouts/_default/summary.html

63 lines
2.8 KiB
HTML
Raw Normal View History

2019-08-18 19:36:52 +02:00
<article class="post" itemscope itemtype="http://schema.org/Article">
2020-01-31 15:53:04 +01:00
{{- $publish_date := .PublishDate.Format (.Site.Params.dateFormatToUse | default "2006-01-02") -}}
{{- $author := .Site.Author.name -}}
{{- if isset .Params "author" -}}
{{- $author = .Site.Author.name -}}
{{- end -}}
2019-08-18 19:36:52 +02:00
<!--featured_image-->
2020-01-31 15:53:04 +01:00
{{- with .Params.featured_image -}}
{{- $image := $.Params.featured_image_preview | default . -}}
<div class="post-featured-image-preview">
2020-01-31 15:53:04 +01:00
{{- $res := resources.Get "svg/loading.svg" | minify -}}
2020-01-31 11:46:28 +01:00
<img src="{{ $res.RelPermalink }}" data-sizes="auto" data-src="{{ $image }}" alt="featured image" class="lazyload">
2019-08-18 19:36:52 +02:00
</div>
2020-01-31 15:53:04 +01:00
{{- end -}}
2019-08-18 19:36:52 +02:00
<!-- end featured_image-->
2019-08-24 13:32:41 +02:00
<h1 class="post-title post-list-title" itemprop="name headline">
<a href="{{ .Permalink }}">{{ .Title }}</a>
</h1>
2019-08-18 19:36:52 +02:00
<div class="post-meta">
<a class="author" href="{{.Site.BaseURL }}" rel="author"><i class="fas fa-user-circle fa-fw"></i>{{ $author }}&nbsp;</a>
{{ T "publish" }}&nbsp;<time datetime={{ $publish_date }}>{{ $publish_date }}</time>&nbsp;
2020-01-31 15:53:04 +01:00
{{- with .Params.categories -}}
2019-08-18 19:36:52 +02:00
<span class="post-category">
2020-01-31 15:53:04 +01:00
{{- T "included" -}}
{{- range . -}}
2019-08-18 19:36:52 +02:00
{{- $name := . -}}
{{- with $.Site.GetPage "taxonomy" (printf "categories/%s" $name) | default ($.Site.GetPage "taxonomy" (printf "categories/%s" ($name | urlize))) -}}
2020-01-31 15:53:04 +01:00
<i class="far fa-folder fa-fw"></i>
<a href="{{ .Permalink }}">{{ $name }}</a>
{{- end -}}
{{- end -}}
2019-08-18 19:36:52 +02:00
</span>
2020-01-31 15:53:04 +01:00
{{- end -}}
2019-08-18 19:36:52 +02:00
</div>
<div class="post-content">
2020-01-31 15:53:04 +01:00
{{- 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 -}}
2019-08-18 19:36:52 +02:00
</div>
<div class="post-footer">
2020-01-30 06:17:42 +01:00
<a href="{{ .Permalink }}">{{ T "readMore" }}</a>
2020-01-31 15:53:04 +01:00
{{- with .Params.tags -}}
2019-08-18 19:36:52 +02:00
<div class="post-tags">
2020-01-31 15:53:04 +01:00
{{- range . -}}
&nbsp;&nbsp;<span class="tag"><a href="{{ "tags/" | absURL }}{{ . | urlize }}/"><i class="fas fa-tag fa-fw"></i>{{ . }}</a></span>
2020-01-31 15:53:04 +01:00
{{- end -}}
2019-08-18 19:36:52 +02:00
</div>
2020-01-31 15:53:04 +01:00
{{- end -}}
2019-08-18 19:36:52 +02:00
</div>
</article>