1
0
Fork 0
hugo-paper/layouts/_default/single.html

68 lines
2 KiB
HTML
Raw Normal View History

2021-08-23 21:59:02 +02:00
{{ define "main" }}
2019-04-01 10:00:48 +02:00
2022-07-18 17:36:39 +02:00
<article>
2022-07-19 17:25:41 +02:00
<header class="mb-20">
2022-07-24 17:57:13 +02:00
<h1 class="!my-0 pb-2.5">{{ .Title }}</h1>
2022-07-18 17:36:39 +02:00
{{ if ne .Type "page" }}
2022-07-24 17:57:13 +02:00
<div class="text-sm opacity-60">
2022-02-12 20:01:09 +01:00
{{ if .Date }}
2021-09-04 00:33:47 +02:00
<time>{{ .Date | time.Format ":date_medium" }}</time>
2022-07-18 17:36:39 +02:00
{{ end }}<!---->
2021-08-20 13:21:20 +02:00
{{ if or .Params.Author site.Author.name }}
2022-07-18 17:36:39 +02:00
<span class="mx-1">&middot;</span>
2021-08-20 13:21:20 +02:00
<span>{{ .Params.Author | default site.Author.name }}</span>
{{ end }}
2022-07-18 17:36:39 +02:00
</div>
{{ end }}
2018-01-08 17:28:39 +01:00
</header>
2022-07-18 17:36:39 +02:00
<section>{{ .Content }}</section>
2021-08-20 13:21:20 +02:00
2021-08-23 21:59:02 +02:00
<!-- Post Tags -->
2021-08-20 13:21:20 +02:00
{{ if .Params.tags }}
2022-07-18 17:36:39 +02:00
<footer class="mt-12 flex flex-wrap">
2021-08-23 21:59:02 +02:00
{{ range .Params.tags }} {{ $href := print (absURL "tags/") (urlize .) }}
2022-07-18 17:36:39 +02:00
<a
2022-07-24 17:57:13 +02:00
class="mr-1.5 mb-1.5 rounded-lg bg-black/[3%] px-5 py-2 no-underline dark:bg-white/[8%]"
2022-07-18 17:36:39 +02:00
href="{{ $href }}"
>{{ . }}</a
>
2021-08-20 13:21:20 +02:00
{{ end }}
2018-01-08 17:28:39 +01:00
</footer>
2021-08-20 13:21:20 +02:00
{{ end }}
2021-08-23 21:59:02 +02:00
<!-- Post Nav -->
{{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }}<!---->
2021-08-20 13:21:20 +02:00
{{ if and (gt (len $pages) 1) (in $pages . ) }}
2022-07-19 17:25:41 +02:00
<nav class="mt-24 flex rounded-lg bg-black/[3%] text-lg dark:bg-white/[8%]">
2021-08-20 13:21:20 +02:00
{{ with $pages.Next . }}
2022-07-24 17:57:13 +02:00
<a class="flex w-1/2 items-center p-6 pr-3 no-underline" href="{{ .Permalink }}"
2022-07-18 17:36:39 +02:00
><span class="mr-1.5"></span><span>{{ .Name }}</span></a
>
{{ end }}<!---->
{{ with $pages.Prev . }}
<a
2022-07-24 17:57:13 +02:00
class="ml-auto flex w-1/2 items-center justify-end p-6 pl-3 no-underline"
2022-07-18 17:36:39 +02:00
href="{{ .Permalink }}"
><span>{{ .Name }}</span><span class="ml-1.5"></span></a
>
2021-08-20 13:21:20 +02:00
{{ end }}
</nav>
{{ end }}
2021-08-23 21:59:02 +02:00
<!-- Disqus -->
2021-08-20 13:21:20 +02:00
{{ if and site.DisqusShortname (not (eq .Params.comments false)) }}
2022-07-18 17:36:39 +02:00
<div id="disqus_thread"></div>
2018-05-04 19:57:25 +02:00
<script>
2022-07-18 17:36:39 +02:00
const disqusShortname = '{{ site.DisqusShortname }}';
const script = document.createElement('script');
2021-08-20 13:21:20 +02:00
script.src = 'https://' + disqusShortname + '.disqus.com/embed.js';
script.setAttribute('data-timestamp', +new Date());
document.head.appendChild(script);
2018-05-04 19:57:25 +02:00
</script>
2021-08-20 13:21:20 +02:00
{{ end }}
2018-01-08 17:28:39 +01:00
</article>
2019-04-01 10:00:48 +02:00
2021-08-23 21:59:02 +02:00
{{ end }}