brainbaking/themes/brainbaking-minimal/layouts/_default/single.html

62 lines
2.2 KiB
HTML

{{ partial "header" . }}
{{ partial "bigimg" . }}
{{ partial "list-item" . }}
<main class="single">
<br>
<div class="text-justify">
<!-- thanks https://www.godo.dev/tutorials/hugo-image-figure-wrap/ -->
{{ $reAltIn := "<p><img src=\"([^\"]+)\" alt=\"([^\"]*)\" /></p>" }}
{{ $reAltOut := "<figure><a href=\"$1\" class=\"lbox\"><img src=\"$1\" alt=\"$2\"></a></figure>" }}
{{ $altContent := .Content | replaceRE $reAltIn $reAltOut | safeHTML }}
{{ $reAltTitleIn := "<p><img src=\"([^\"]+)\" alt=\"([^\"]*)\" title=\"([^\"]+)\" /></p>" }}
{{ $reAltTitleOut := "<figure><a href=\"$1\" class=\"lbox\"><img src=\"$1\" alt=\"$3\" title=\"$3\"></a><figcaption>$3</figcaption></figure>" }}
{{ $finalContent := $altContent | replaceRE $reAltTitleIn $reAltTitleOut | safeHTML }}
{{ $finalContent }}
</div>
<!-- related posts with the same tags -->
{{ $related := first 3 (where (where .Site.RegularPages.ByDate.Reverse ".Params.tags" "intersect" .Params.tags) "Permalink" "!=" .Permalink) }}
{{ if $related }}
<h4 class="page-header"><svg class='icon icon-text'><use xlink:href='#news'></use></svg>Related Articles</h4>
<div class="text-justify">
{{ range $related }} {{ partial "related-item" . }} {{ end }}
</div>
<hr/>
{{ end }}
<!-- commenting part -->
{{ if (not .Params.disableComments) }}
<h4 class="page-header"><svg class='icon icon-text'><use xlink:href='#discuss'></use></svg>
{{ if eq "essays" .Section }}
Discussieer mee
{{ else }}
Join the Discussion
{{ end }}
</h4>
{{- if (ne hugo.Environment "development") }}
<script defer src="https://commento.brainbaking.com/js/commento.js"></script>
<script src="https://commento.brainbaking.com/js/count.js"></script>
<div id="commento"></div>
{{- else }}
(localhost, comments disabled)
{{- end }}
{{ end }}
<h4 class="page-header">&nbsp;</h4>
<svg class='icon icon-text'><use xlink:href='#up'></use></svg><a href="#top">Top</a>
</main>
{{ partial "footer.html" . }}