This commit is contained in:
ryfrd 2025-08-14 15:16:21 +01:00
parent c4dcb6e38b
commit 531029a18f
129 changed files with 7765 additions and 6938 deletions

1
layouts/404.html Normal file
View file

@ -0,0 +1 @@
<h1>uhoh 404 :/</h1>

View file

@ -0,0 +1,9 @@
<!doctype html>
<html lang="{{ .Site.Language.Lang }}">
{{- partial "head.html" . -}}
<body>
{{- partial "header.html" . -}}
<main id="content">{{ block "main" . }}{{ end }}</main>
{{ partial "footer.html" . }}
</body>
</html>

View file

@ -0,0 +1,9 @@
{{- $.Scratch.Add "index" slice -}}
{{- range .Site.RegularPages -}}
{{- $.Scratch.Add "index" (dict
"title" .Title
"summary" .Summary
"url" .Permalink
"content" .Plain) -}}
{{- end -}}
{{- $.Scratch.Get "index" | jsonify -}}

View file

@ -0,0 +1,4 @@
{{ define "main" }} {{ range where site.RegularPages "Type" "in"
site.Params.mainSections }}
<a href="{{ .RelPermalink}}">{{ .Title }}</a>
{{ end }} {{ end }}

41
layouts/_default/rss.xml Normal file
View file

@ -0,0 +1,41 @@
{{- $pctx := . -}}
{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}}
{{- $pages := slice -}}
{{- if or $.IsHome $.IsSection -}}
{{- $pages = $pctx.RegularPages -}}
{{- else -}}
{{- $pages = $pctx.Pages -}}
{{- end -}}
{{- $limit := .Site.Config.Services.RSS.Limit -}}
{{- if ge $limit 1 -}}
{{- $pages = $pages | first $limit -}}
{{- end -}}
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title>
<link>{{ .Permalink }}</link>
<description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}</description>
<generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }}
<language>{{.}}</language>{{end}}{{ with .Site.Author.email }}
<managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }}
<webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }}
<copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }}
<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
{{ with .OutputFormats.Get "RSS" }}
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
{{ end }}
{{ range where .Site.Pages "Kind" "page" }}
{{ if or (eq .Section "posts") (eq .Section "post") }}
<item>
<title>{{ .Title }}</title>
<link>{{ .Permalink }}</link>
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
{{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}}
<guid>{{ .Permalink }}</guid>
<description>{{ .Content | html }}</description>
</item>
{{ end }}
{{ end }}
</channel>
</rss>

View file

@ -0,0 +1,15 @@
{{ define "main" }}
<article>
<header id="post-header">
<h3>{{ .Title }}</h3>
<div>
{{- if isset .Params "date" -}} {{ if eq .Lastmod .Date }}
<time>{{ .Date | time.Format (i18n "post.created") }}</time>
{{ else }}
<time>{{ .Lastmod | time.Format (i18n "post.updated") }}</time>
{{ end }} {{- end -}}
</div>
</header>
{{- .Content -}}
</article>
{{ end }}

3
layouts/index.html Normal file
View file

@ -0,0 +1,3 @@
{{ define "main" }}
{{ partial "results.html" . }}
{{ end }}

View file

@ -0,0 +1,10 @@
<!-- <hr /> -->
<footer id="footer">
<small>
made with <a href="https://gohugo.io">hugo</a> and my bastardised version of
<a href="https://github.com/LukasJoswiak/etch">this nice theme</a>
</small>
<!-- search javascript -->
<script src="/js/search.js"></script>
<script src="/js/toggle.js"></script>
</footer>

View file

@ -0,0 +1,16 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{{ with .Site.Params.description -}}
<meta name="description" content="{{ . }}">
{{ end }}
{{ printf `<link rel="shortcut icon" href="%s">` ("favicon.ico" | absURL) | safeHTML }}
{{ with .OutputFormats.Get "rss" -}}
{{ printf `<link rel="%s" type="%s" href="%s" title="%s">` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
{{ end -}}
<link id="stylesheet" rel="stylesheet" href="/css/light.css">
<link rel="canonical" href="{{ .Permalink }}" />
<title>{{ .Title }}</title>
</head>

View file

@ -0,0 +1,19 @@
<header id="banner">
<nav class="navbar">
<div class="nav-left">
<!-- home -->
<a href="{{ .Site.BaseURL }}" class="home">🏠</a>
<!-- menu items -->
{{ range .Site.Menus.main.ByWeight -}} {{ .Pre }}<a
href="{{ .URL }}"
title="{{ .Title }}"
>{{- .Name -}}</a
>{{ .Post }} {{- end }}
</div>
<div class="nav-right">
{{ partial "search.html" . }}
<!-- theme toggle -->
<button id="toggle-button" class="toggle-button" onclick="toggleTheme()">🌚</button>
</div>
</nav>
</header>

View file

@ -0,0 +1,5 @@
<ul id="results">
{{ range where site.RegularPages "Type" "in" site.Params.mainSections }}
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
{{ end }}
</ul>

View file

@ -0,0 +1 @@
<input type="text" id="search" placeholder="🔎 leaf through the archive"/>