redstrate.com/themes/red/layouts/_default/single.html

140 lines
4.4 KiB
HTML
Raw Normal View History

2022-08-02 14:05:56 -04:00
{{ define "main" }}
<h2>{{ .Title }}</h2>
2022-12-27 22:34:31 -05:00
{{ if in .File.Dir "blog" }}
<i style="margin: 0">
2022-12-27 22:34:31 -05:00
Posted on
2023-04-17 15:18:56 -04:00
<time datetime="{{ .Page.Lastmod.Format "2006-01-02" }}" class="text-muted">
2022-12-27 22:34:31 -05:00
{{ $.Date.Format "January 02, 2006" }}
</time>
2023-04-17 15:18:56 -04:00
<time datetime="{{ .Page.Lastmod.Format "2006-01-02" }}" class="text-muted">
2023-04-26 12:44:49 -04:00
(Updated on {{ $.Page.Lastmod.Format "January 02, 2006" }})
</time>
</i>
<br>
<span>Tags:</span>
{{ $terms := .GetTerms "tags" }}
{{ range $terms }}
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
{{ end }}
{{ end }}
2022-08-02 14:05:56 -04:00
2023-02-23 17:39:20 -05:00
<hr>
2023-04-17 16:03:42 -04:00
{{ if .Params.toc }}
2023-04-17 16:01:13 -04:00
<details>
<summary>Table of Contents</summary>
{{ .Page.TableOfContents }}
</details>
{{ end }}
{{ .Content }}
2022-09-12 10:53:34 -04:00
2025-01-03 17:02:37 -05:00
{{ $series_name := "" }}
{{ with .Page.GetTerms "series" }}
{{ range . }}
{{ $series_name = (string .Title) }}
{{ end }}
{{ end }}
{{ with $series_name }}
{{ $series_pages := slice }}
{{ range $name, $pages := $.Site.Taxonomies.series }}
{{ if eq (lower $series_name) $name }}
{{ $series_pages = $pages }}
{{ end }}
{{ end }}
{{ $prev := "" }}
{{ $next := "" }}
{{ range (sort $series_pages "Date" "desc") }}
{{ if gt $.Date.Unix .Date.Unix }}
{{ $prev = .Path }}
{{ break }}
{{ end }}
{{ end }}
{{ range (sort $series_pages "Date" "asc") }}
{{ if lt $.Date.Unix .Date.Unix }}
{{ $next = .Path }}
{{ break }}
{{ end }}
{{ end }}
2025-03-17 08:58:49 -04:00
<div id="seriesnav" class="art-button-container">
2025-01-03 17:02:37 -05:00
{{ if $prev }}
{{ with $.Page.GetPage $prev }}
<a class="art-button" href="{{ .RelPermalink }}">{{ .Title }}</a>
{{ end }}
{{ else }}
<a class="art-button disabled">End</a>
{{ end }}
{{ with $.Page.GetTerms "series" }}
{{ range . }}
<a class="art-button" href="{{ .RelPermalink }}">{{ .Title }}</p>
{{ end }}
{{ end }}
{{ if $next }}
{{ with $.Page.GetPage $next }}
<a class="art-button" href="{{ .RelPermalink }}">{{ .Title }}</a>
{{ end }}
{{ else }}
<a class="art-button disabled">End</a>
{{ end }}
</div>
{{ end }}
{{ if in .File.Dir "blog" }}
{{ partial "voting" . }}
2025-03-17 09:12:55 -04:00
{{ partial "related" . }}
2022-12-27 22:34:31 -05:00
{{ partial "comments" . }}
{{ end }}
2023-07-03 11:03:07 -04:00
2025-01-03 13:47:42 -05:00
{{ if .HasShortcode "three-scene" }}
2023-07-03 11:03:07 -04:00
{{ $imagesloaded := resources.Get "js/three.js" }}
{{ if hugo.IsProduction }}
{{ $imagesloaded = $imagesloaded | minify | fingerprint | resources.PostProcess }}
{{ end }}
<script src="{{ $imagesloaded.RelPermalink }}" integrity="{{ $imagesloaded.Data.Integrity }}"></script>
{{ end }}
{{ if .Params.math }}
{{ $math := resources.Get "js/katex.js" }}
{{ if hugo.IsProduction }}
{{ $math = $math | minify | fingerprint | resources.PostProcess }}
{{ end }}
<script src="{{ $math.RelPermalink }}" integrity="{{ $math.Data.Integrity }}"></script>
{{ $autorender := resources.Get "js/auto-render.js" }}
{{ if hugo.IsProduction }}
{{ $autorender = $autorender | minify | fingerprint | resources.PostProcess }}
{{ end }}
<script src="{{ $autorender.RelPermalink }}" integrity="{{ $autorender.Data.Integrity }}"></script>
{{ $style := resources.Get "css/katex.css" }}
{{ if hugo.IsProduction }}
{{ $style = $style | minify | fingerprint | resources.PostProcess }}
{{ end }}
<link href="{{ $style.RelPermalink }}" integrity="{{ $style.Data.Integrity }}" rel="stylesheet">
<script>
document.addEventListener("DOMContentLoaded", function() {
renderMathInElement(document.body, {
delimiters: [
{left: "$$", right: "$$", display: true},
{left: "$", right: "$", display: false}
]
});
});
</script>
{{ end }}
2022-08-02 14:05:56 -04:00
{{ end }}