redzuurdesem/themes/desem-swift-theme/layouts/_default/single.html

93 lines
2.6 KiB
HTML

{{- define "main" }}
{{- $scratch := newScratch }}
{{- if isset .Params "image" }}
{{- $scratch.Set "image" .Params.image }}
{{- else }}
{{- if isset .Params "featured_image" }}
{{- $scratch.Set "image" .Params.featured_image }}
{{- else }}
{{- $scratch.Set "image" "nop" }}
{{- end }}
{{- end }}
{{- $image := $scratch.Get "image" }}
{{ if eq $image "nop" }}
<section style='margin-top: 5em'>
</section>
{{ else }}
{{- $bg := ( $image | absLangURL) }}
<section class = 'post_header' style = 'background-image:url({{ $bg }});'>
<div class='post_header_tags'>
<div class = 'excerpt_meta'>
{{- with .Params.tags -}}
{{- range first 10 . }}
{{- $tag := . | urlize }}
<a href='{{ absURL (printf "tags/%s" $tag) }}' class='post_tag p-category'>
{{- . }}
</a>
{{- end }}
{{- end }}
</div>
</div>
</section>
{{ end }}
<div class = 'post' data-pagefind-body>
<div class='post_metadata'>
<hr/>
<h1 class='post_title p-name'>
{{- if isset .Params "title" }}
{{ .Title }}
{{- else }}
Post op {{ .Lastmod.Format (.Site.Params.dateFormat | default "2 January 2006") }}
{{- end }}
</h1>
{{ if isset .Params "date" }}
<div class="titlemeta">
<svg>
<use xlink:href="#calendar"></use>
</svg>
<time datetime='{{ .Date.Format "2006-01-02" }}' class="dt-published">
<a class="u-url u-uid" href="{{ .RelPermalink }}">
{{ .Lastmod.Format (.Site.Params.dateFormat | default "2 January 2006") }}
</a>
</time>
</div>
{{ end }}
{{- if isset .Params "link" }}
Ook beschikbaar op dit platform:
<a href="{{ .Params.link }}" class="u-syndication" target="_blank" rel="noopener" style="text-decoration: underline;">
publicatielink
</a>.
{{- end }}
<hr/>
</div>
<article class='post_content e-content'>
{{- .Content }}
<div class = 'post_extra'>
{{- partial "copy" . }}
</div>
</article>
</div>
<div class='post p-author h-card'>
<p class="p-note">
Geschreven voor <a rel="me" class="u-url" href="{{ .Permalink }}">{{ .Site.Title }}</a> door
<span class="p-name">
{{ if isset .Params "author" }}
{{ .Params.author }}
{{ else }}
{{ .Site.Author.name }}
{{ end }}
</span>.
<img class="u-photo" src="/images/badge.png" alt="Logo" style="display: none" />
</p>
</div>
<div class='post p-author h-card'>
<aside>
{{- partial "aside" . }}
</aside>
</div>
<hr/>
{{- end }}