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

106 lines
3.1 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>
2023-07-05 20:03:28 +02:00
<header class="mb-16">
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" }}
2023-07-05 20:03:28 +02:00
<div class="text-sm antialiased 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 }}<!---->
2023-02-24 18:51:26 +01:00
{{ $single_author := or .Params.Author site.Author.name }}
<!---->
{{ if $single_author }}
2022-07-18 17:36:39 +02:00
<span class="mx-1">&middot;</span>
2023-02-24 18:51:26 +01:00
<span>{{ $single_author }}</span>
2021-08-20 13:21:20 +02:00
{{ 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
2023-06-06 20:23:47 +02:00
class="mb-1.5 mr-1.5 rounded-lg bg-black/[3%] px-5 py-1.5 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 -->
2023-08-14 22:41:30 +02:00
{{ if not site.Params.disablePostNavigation }}<!---->
2021-08-23 21:59:02 +02:00
{{ $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 . ) }}
2023-02-05 18:53:44 +01: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-11-15 01:06:02 +01:00
<a
2023-07-05 20:03:28 +02:00
class="flex w-1/2 items-center rounded-l-md p-6 pr-3 font-semibold no-underline hover:bg-black/[2%] dark:hover:bg-white/[3%]"
2022-11-15 01:06:02 +01:00
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
2023-07-05 20:03:28 +02:00
class="ml-auto flex w-1/2 items-center justify-end rounded-r-md p-6 pl-3 font-semibold no-underline hover:bg-black/[2%] dark:hover:bg-white/[3%]"
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>
2023-08-14 22:41:30 +02:00
{{ end }}<!---->
2021-08-20 13:21:20 +02:00
{{ 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-12-26 19:59:42 +01:00
<div class="mt-24" 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 }}
2023-01-07 11:49:42 +01:00
2023-01-08 18:49:43 +01:00
<!-- GraphComment -->
{{ if and site.Params.graphCommentId (not (eq .Params.comments false)) }}
2023-01-07 11:49:42 +01:00
<div class="mt-24" id="graphcomment"></div>
<script type="text/javascript">
var __semio__params = {
2023-01-08 18:49:43 +01:00
graphcommentId: '{{ site.Params.graphCommentId }}',
2023-01-07 11:49:42 +01:00
behaviour: {
2023-01-08 18:49:43 +01:00
// uid: "...",
2023-01-07 11:49:42 +01:00
},
// configure your variables here
2023-01-08 18:49:43 +01:00
};
2023-01-07 11:49:42 +01:00
function __semio__onload() {
2023-01-08 18:49:43 +01:00
__semio__gc_graphlogin(__semio__params);
2023-01-07 11:49:42 +01:00
}
2023-01-08 18:49:43 +01:00
(function () {
var gc = document.createElement('script');
gc.type = 'text/javascript';
gc.async = true;
gc.onload = __semio__onload;
gc.defer = true;
gc.src =
'https://integration.graphcomment.com/gc_graphlogin.js?' + Date.now();
(
document.getElementsByTagName('head')[0] ||
document.getElementsByTagName('body')[0]
).appendChild(gc);
2023-01-07 11:49:42 +01:00
})();
</script>
{{ 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 }}