2020-07-06 18:55:32 +00:00
|
|
|
{{ define "main" }}
|
2020-07-12 14:28:51 +00:00
|
|
|
{{ $pages := where .RegularPages "Type" "in" .Site.Params.mainSections }}
|
|
|
|
{{ if (eq .Kind "home") }}
|
|
|
|
{{ $pages = where .Site.RegularPages "Type" "in" .Site.Params.mainSections }}
|
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
{{ $paginator := .Paginate $pages }}
|
|
|
|
{{ range $paginator.Pages }}
|
|
|
|
<article class="gblog-post">
|
|
|
|
<header class="gblog-post__header">
|
|
|
|
<h1><a href="{{ .RelPermalink }}">{{ partial "title" . }}</a></h1>
|
|
|
|
</header>
|
|
|
|
|
|
|
|
<section class="gblog-markdown">
|
|
|
|
{{ .Summary }}
|
|
|
|
</section>
|
|
|
|
<div class="gblog-post__readmore">
|
|
|
|
{{ if .Truncated }}
|
2020-07-17 17:19:03 +00:00
|
|
|
<a class="flex-inline align-center fake-link" title="Read full post" href="{{ .RelPermalink }}">Read full post</a>
|
2020-07-12 14:28:51 +00:00
|
|
|
{{ end }}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<footer class="gblog-post__footer">
|
|
|
|
<span class="no-wrap">
|
2021-05-23 20:04:57 +00:00
|
|
|
<svg class="icon gblog_date"><use xlink:href="#gblog_date"></use></svg>
|
2020-07-13 07:00:19 +00:00
|
|
|
<span class="gblog-post__tag">
|
2020-08-25 21:33:35 +00:00
|
|
|
<time datetime="{{ .Lastmod.Format "2006-01-02T15:04:05Z07:00" | safeHTML }}">
|
2020-09-16 07:38:44 +00:00
|
|
|
{{ if .Lastmod.After (.Date.AddDate 0 0 1) }}
|
2020-08-25 21:33:35 +00:00
|
|
|
Updated on
|
|
|
|
{{ end }}
|
|
|
|
{{ .Lastmod.Format "Jan 2, 2006" }}
|
2020-07-13 07:00:19 +00:00
|
|
|
</time>
|
|
|
|
</span>
|
2020-07-12 14:28:51 +00:00
|
|
|
</span>
|
2020-07-13 07:00:19 +00:00
|
|
|
|
2020-08-25 21:57:08 +00:00
|
|
|
<span class="no-wrap">
|
2021-05-23 20:04:57 +00:00
|
|
|
<svg class="icon gblog_timer"><use xlink:href="#gblog_timer"></use></svg>
|
2020-08-25 22:13:53 +00:00
|
|
|
<span class="gblog-post__tag">{{ .ReadingTime }} min read</span>
|
2020-08-25 21:57:08 +00:00
|
|
|
</span>
|
|
|
|
|
2021-09-23 08:50:42 +00:00
|
|
|
{{ if eq .Params.weight 1 }}
|
2020-07-13 07:00:19 +00:00
|
|
|
<span class="no-wrap">
|
2021-05-23 20:04:57 +00:00
|
|
|
<svg class="icon gblog_pin"><use xlink:href="#gblog_pin"></use></svg>
|
2020-07-13 07:00:19 +00:00
|
|
|
<span class="gblog-post__tag">Pinned</span>
|
2020-07-12 14:28:51 +00:00
|
|
|
</span>
|
2020-07-13 07:00:19 +00:00
|
|
|
{{ end }}
|
2020-07-12 14:28:51 +00:00
|
|
|
|
|
|
|
{{ $ac := 0 }}
|
|
|
|
{{ with .Params.authors }}
|
|
|
|
{{ range sort . }}
|
|
|
|
{{ $author := index $.Site.Data.authors . }}
|
2020-11-28 16:12:15 +00:00
|
|
|
{{ with $.Site.GetPage (printf "/authors/%s" . | urlize) }}
|
2020-07-12 14:28:51 +00:00
|
|
|
{{ if eq $ac 0 }}
|
|
|
|
<span class="no-wrap">
|
2021-05-23 20:04:57 +00:00
|
|
|
<svg class="icon gblog_person"><use xlink:href="#gblog_person"></use></svg>
|
2020-07-12 14:28:51 +00:00
|
|
|
{{ template "post-author" dict "name" $author.name "page" . }}
|
|
|
|
</span>
|
|
|
|
{{ else }}
|
|
|
|
{{ template "post-author" dict "name" $author.name "page" . }}
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
|
{{ $ac = (add $ac 1) }}
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
{{ $tc := 0 }}
|
|
|
|
{{ with .Params.tags }}
|
|
|
|
{{ range sort . }}
|
|
|
|
{{ $name := . }}
|
|
|
|
{{ with $.Site.GetPage (printf "/tags/%s" $name | urlize) }}
|
|
|
|
{{ if eq $tc 0 }}
|
|
|
|
<span class="no-wrap">
|
2021-05-23 20:04:57 +00:00
|
|
|
<svg class="icon gblog_bookmarks"><use xlink:href="#gblog_bookmarks"></use></svg>
|
2020-07-12 14:28:51 +00:00
|
|
|
{{ template "post-tag" dict "name" $name "page" . }}
|
|
|
|
</span>
|
|
|
|
{{ else }}
|
|
|
|
{{ template "post-tag" dict "name" $name "page" . }}
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
|
{{ $tc = (add $tc 1) }}
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
|
</footer>
|
|
|
|
</article>
|
2020-07-06 18:55:32 +00:00
|
|
|
{{ end }}
|
|
|
|
{{ partial "pagination.html" . }}
|
|
|
|
{{ end }}
|
2020-07-12 14:28:51 +00:00
|
|
|
|
|
|
|
{{ define "post-tag" }}
|
|
|
|
<span class="gblog-post__tag gblog-button">
|
|
|
|
<a class="gblog-button__link" href="{{ .page.RelPermalink }}" title="All posts tagged with '{{ .name }}'">{{ .name }}</a>
|
|
|
|
</span>
|
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
{{ define "post-author" }}
|
|
|
|
<span class="gblog-post__tag gblog-button">
|
|
|
|
<a class="gblog-button__link" href="{{ .page.RelPermalink }}" title="All posts of this author">{{ .name }}</a>
|
|
|
|
</span>
|
|
|
|
{{ end }}
|