This commit is contained in:
fzorb 2025-03-06 12:45:26 +02:00
parent f25c5cb60c
commit 3475c31d71
38 changed files with 158 additions and 359 deletions

View file

@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="{{ site.Language.LanguageCode }}" dir="{{ or site.Language.LanguageDirection `ltr` }}">
<head>
{{ partial "head.html" . }}
</head>
<body>
<div class="content">
<header>
{{ partial "header.html" . }}
</header>
<hr>
{{ block "main" . }}{{ end }}
<footer>
{{ partial "footer.html" . }}
</footer>
</div>
</body>
</html>

View file

@ -0,0 +1,17 @@
{{ define "main" }}
<div class="row">
<main class="one">
{{ .Content }}
</main>
<main class="two">
<ul>
{{ range ( where .Site.RegularPages "Type" "posts" | first 4 ) }}
<li><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li>
{{ end }}
<li><a href="/posts">... and more</a>
</ul>
</main>
</div>
{{ end }}

View file

@ -0,0 +1,9 @@
{{ define "main" }}
<h1>{{ .Title }}</h1>
{{ .Content }}
<ul>
{{ range .Pages }}
<li><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li>
{{ end }}
</ul>
{{ end }}

View file

@ -0,0 +1,10 @@
{{ define "main" }}
<a href="/"><- return to index</a>
<h1>{{ .Title }}</h1>
{{ if .Date }}
<time datetime="{{ .Date }}">{{ .Date.Format "January 2, 2006" }}</time>
{{ end }}
{{ .Content }}
{{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }}
{{ end }}

View file

@ -0,0 +1,9 @@
<hr>
<div class="links">
Live free or die<br>
[<a href="mailto:fzorb@fzorb.xyz">email</a>] // [<a href="xmpp:fzorb@xmpp.is">xmpp</a>] // [<a href="/pub.asc">pgp</a>]<br>
All content on this page is released under <a href='https://creativecommons.org/publicdomain/zero/1.0/'>CC0</a>
</div>
<!--<div class="links">
[<a href="">tor</a>] // [<a href="">i2p</a>] // [<a href="">yggdrasil</a>]
</div>-->

View file

@ -0,0 +1,5 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>{{ if .IsHome }}{{ site.Title }}{{ else }}{{ printf "%s | %s" .Title site.Title }}{{ end }}</title>
{{ partialCached "head/css.html" . }}
{{ partialCached "head/js.html" . }}

View file

@ -0,0 +1,2 @@
<link rel="stylesheet" href="/style.css">

View file

@ -0,0 +1,12 @@
{{- with resources.Get "js/main.js" }}
{{- if eq hugo.Environment "development" }}
{{- with . | js.Build }}
<script src="{{ .RelPermalink }}"></script>
{{- end }}
{{- else }}
{{- $opts := dict "minify" true }}
{{- with . | js.Build $opts | fingerprint }}
<script src="{{ .RelPermalink }}" integrity="{{- .Data.Integrity }}" crossorigin="anonymous"></script>
{{- end }}
{{- end }}
{{- end }}

View file

@ -0,0 +1 @@
<h1>{{ site.Title }}</h1>

View file

@ -0,0 +1,51 @@
{{- /*
Renders a menu for the given menu ID.
@context {page} page The current page.
@context {string} menuID The menu ID.
@example: {{ partial "menu.html" (dict "menuID" "main" "page" .) }}
*/}}
{{- $page := .page }}
{{- $menuID := .menuID }}
{{- with index site.Menus $menuID }}
<nav>
<ul>
{{- partial "inline/menu/walk.html" (dict "page" $page "menuEntries" .) }}
</ul>
</nav>
{{- end }}
{{- define "partials/inline/menu/walk.html" }}
{{- $page := .page }}
{{- range .menuEntries }}
{{- $attrs := dict "href" .URL }}
{{- if $page.IsMenuCurrent .Menu . }}
{{- $attrs = merge $attrs (dict "class" "active" "aria-current" "page") }}
{{- else if $page.HasMenuCurrent .Menu .}}
{{- $attrs = merge $attrs (dict "class" "ancestor" "aria-current" "true") }}
{{- end }}
{{- $name := .Name }}
{{- with .Identifier }}
{{- with T . }}
{{- $name = . }}
{{- end }}
{{- end }}
<li>
<a
{{- range $k, $v := $attrs }}
{{- with $v }}
{{- printf " %s=%q" $k $v | safeHTMLAttr }}
{{- end }}
{{- end -}}
>{{ $name }}</a>
{{- with .Children }}
<ul>
{{- partial "inline/menu/walk.html" (dict "page" $page "menuEntries" .) }}
</ul>
{{- end }}
</li>
{{- end }}
{{- end }}

View file

@ -0,0 +1,23 @@
{{- /*
For a given taxonomy, renders a list of terms assigned to the page.
@context {page} page The current page.
@context {string} taxonomy The taxonomy.
@example: {{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }}
*/}}
{{- $page := .page }}
{{- $taxonomy := .taxonomy }}
{{- with $page.GetTerms $taxonomy }}
{{- $label := (index . 0).Parent.LinkTitle }}
<div>
<div>{{ $label }}:</div>
<ul>
{{- range . }}
<li><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li>
{{- end }}
</ul>
</div>
{{- end }}