hugo-geekblog/layouts/_default/single.html

46 lines
2.0 KiB
HTML
Raw Normal View History

2020-07-06 18:55:32 +00:00
{{ define "main" }}
<article class="gblog-post">
<header class="gblog-post__header">
2020-07-26 12:47:12 +00:00
{{ $source := ($.Resources.ByType "image").GetMatch "{*feature*,*cover*,*thumbnail*}" }}
{{ with $source }}
2020-07-27 18:17:55 +00:00
<div class="gblog-post__feature">
<picture>
{{ $featured := .Fill (printf "910x280 %s" (default "Smart" .Params.anchor)) }}
2020-07-26 12:47:12 +00:00
<source srcset="{{ $featured.Permalink }}">
<img src="{{ $featured.Permalink }}" alt="{{ default $.Title .Params.description }}" >
</picture>
2020-07-27 18:17:55 +00:00
{{ with $source.Params.credits }}
<span>Credits: {{ . | $.Page.RenderString | safeHTML }}</span>
2020-07-27 18:17:55 +00:00
{{ end }}
</div>
2020-07-26 12:47:12 +00:00
{{ end }}
2020-07-06 18:55:32 +00:00
<h1>{{ partial "title" . }}</h1>
2020-11-28 15:50:56 +00:00
{{ if or (eq .Type (default "posts" .Site.Params.GeekblogContentSection)) (eq .Type "post") }}
<div class="gblog-post__meta">
<span class="no-wrap">
<svg class="icon gblog_date"><use xlink:href="#gblog_date"></use></svg>
<span class="gblog-post__tag">
<time datetime="{{ .Lastmod.Format "2006-01-02T15:04:05Z07:00" | safeHTML }}">
{{ if ne (.Lastmod.Format "2006-01-02") (.Date.Format "2006-01-02") }}
Updated on
{{ end }}
{{ .Lastmod.Format "Jan 2, 2006" }}
</time>
</span>
</span>
<span class="no-wrap">
<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>
</span>
</div>
{{ end }}
2020-07-06 18:55:32 +00:00
</header>
<section class="gblog-markdown">
{{ partial "content" . }}
</section>
</article>
{{ end }}