1
0
Fork 0
hugo-paper/layouts/_default/single.html
2022-02-12 20:01:09 +01:00

51 lines
1.6 KiB
HTML

{{ define "main" }}
<article class="post-single">
<header class="post-title">
<p>
{{ if .Date }}
<time>{{ .Date | time.Format ":date_medium" }}</time>
{{ end }}
{{ if or .Params.Author site.Author.name }}
<span>{{ .Params.Author | default site.Author.name }}</span>
{{ end }}
</p>
<h1>{{ .Title }}</h1>
</header>
<section class="post-content">{{ .Content }}</section>
<!-- Post Tags -->
{{ if .Params.tags }}
<footer class="post-tags">
{{ range .Params.tags }} {{ $href := print (absURL "tags/") (urlize .) }}
<a href="{{ $href }}">{{ . }}</a>
{{ end }}
</footer>
{{ end }}
<!-- Post Nav -->
{{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }}<!---->
{{ if and (gt (len $pages) 1) (in $pages . ) }}
<nav class="post-nav">
{{ with $pages.Next . }}
<a class="prev" href="{{ .Permalink }}"><span></span><span>{{ .Name }}</span></a>
{{ end }} {{ with $pages.Prev . }}
<a class="next" href="{{ .Permalink }}"><span>{{ .Name }}</span><span></span></a>
{{ end }}
</nav>
{{ end }}
<!-- Disqus -->
{{ if and site.DisqusShortname (not (eq .Params.comments false)) }}
<div id="disqus_thread" class="post-comments"></div>
<script>
var disqusShortname = '{{ site.DisqusShortname }}';
var script = document.createElement('script');
script.src = 'https://' + disqusShortname + '.disqus.com/embed.js';
script.setAttribute('data-timestamp', +new Date());
document.head.appendChild(script);
</script>
{{ end }}
</article>
{{ end }}