antidocs theme

This commit is contained in:
Nox Sluijtman 2024-02-11 01:09:03 +01:00
parent 53560c95d3
commit eb4af4bb88
13 changed files with 641 additions and 0 deletions

View file

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
{{- partial "head.html" . -}}
<title>{{ if .IsHome }}{{ $.Site.Title }}{{ else }}{{ .Title }} | {{ $.Site.Title }}{{ end }}</title>
</head>
<body>
{{- partial "header.html" . -}}
<main>
{{- block "main" . }}{{- end }}
</main>
{{- partial "footer.html" . -}}
</body>
</html>

View file

@ -0,0 +1,20 @@
{{ define "main" }}
{{ if .Content }}
<article>
{{ .Content -}}
</article>
{{ else }}
<h1>{{ .Title }}</h1>
{{ end }}
<div class="posts">
<table>
{{ range .Paginator.Pages }}
<tr>
<td><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></td>
<td>{{ .Params.Author }}</td>
<td class="post-tags"> {{ range .Params.tags }} #<a href="{{ (urlize (printf "tags/%s/" .)) | absLangURL }}">{{ . }}</a>&nbsp; {{ end }}</td>
</tr>
{{ end }}
</table>
</div>
{{ end }}

View file

@ -0,0 +1,39 @@
{{ define "main" }}
<div class="article-head">
<h1>
{{ .Title | markdownify }}
-
{{ if .Params.Author }}
{{ .Params.Author | markdownify }}
{{ end }}
</h1>
<span class="post-reading-time">~ {{ .ReadingTime }} min ({{ .WordCount }} {{ (.Params.WordCounter | default .Site.Params.WordCounter) | default "words" }})</span>
{{ if .Params.documentSource }}
<code><a href="{{ .Params.documentSource }}">markdown source</a></code>
{{ end }}
</div>
{{ if (.Params.Toc | default .Site.Params.Toc) }}
<h2>
{{ (.Params.TocTitle | default .Site.Params.TocTitle) | default "Table of Contents" }}
</h2>
{{ .TableOfContents }}
{{ end }}
<article class="post-content">
{{- with .Content -}}
{{ . | replaceRE "(<h[1-9] id=\"([^\"]+)\".+)(</h[1-9]+>)" `${1} <a href="#${2}" class="anchor" ariaLabel="Anchor">§</a> ${3}` | safeHTML }}
{{- end -}}
</article>
{{ if .Params.sources }}
<hr/>
<h3 class="post-reading-time">{{ ( .Params.SourcesName | default .Site.Params.SourcesName) | default "sources" }}:</h3>
<ol>
{{ range .Params.sources }}
<li class="post-tags"><a href="{{ . }}">{{ . }}</a></li>
{{ end }}
</ol>
{{ end }}
{{ end }}