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

88 lines
2.3 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'>
{{- . }}
</a>
{{- end }}
{{- end }}
</div>
</div>
</section>
{{ end }}
<div class = 'post'>
<div class='post_metadata'>
<hr/>
<h1 class='post_title'>
{{- if isset .Params "title" }}
{{ .Title }}
{{- else }}
Post op {{ .Lastmod.Format (.Site.Params.dateFormat | default "2 January 2006") }}
{{- end }}
{{- if isset .Params "link" }}
(<a href="{{ .Params.link }}" target="_blank" rel="noopener" style="text-decoration: underline;">link</a>)
{{- end }}
</h1>
{{ if isset .Params "date" }}
<div class="titlemeta">
<svg>
<use xlink:href="#calendar"></use>
</svg>
{{ .Lastmod.Format (.Site.Params.dateFormat | default "2 January 2006") }}
</div>
{{ end }}
<hr/>
</div>
<article class='post_content'>
{{- .Content }}
<div class = 'post_extra'>
{{- partial "copy" . }}
</div>
</article>
</div>
<div class='post'>
<aside>
{{- partial "aside" . }}
</aside>
</div>
{{ if not (isset .Params "disablefb") }}
<hr/>
<div class='post'>
<article class='post_content' style="text-align: center;">
<h3 id="fb-community-header">Facebook community &raquo;</h3>
<p>Klik op '<em>Berichten</em>' en laat iets van je horen!</p>
<p>
<a href="https://facebook.com/redzuurdesem/" target="_blank" rel="noopener">
<img src="/fb/fbwidget.jpg" id="fbwidget" alt="Facebook Widget Screenshot" />
</a>
</p>
</article>
</div>
{{ end }}
{{- end }}