This commit is contained in:
ryfrd 2025-08-20 15:19:24 +01:00
parent 2a9167cb7e
commit 96573664a6
95 changed files with 4130 additions and 2328 deletions

View file

@ -0,0 +1,36 @@
{{ define "main" }}
<p>This is not a very clever search. It simply looks if the content of a post contains your query. </p>
<input type="text" id="search" placeholder="🔎 leaf through the archive"/>
<ul id="results"></ul>
<p>Alternatively, this is everything.</p>
{{ $pages := where site.RegularPages "Type" "posts" }}
{{ $years := $pages.GroupByDate "2006" }}
<ul class="tree">
{{ range $years }}
<li>
<span class="folder">{{ .Key }}</span>
<ul>
{{ $months := .Pages.GroupByDate "January" }}
{{ range $months }}
<li>
<span class="folder">{{ .Key }}</span>
<ul>
{{ range .Pages }}
<li>
<a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
</li>
{{ end }}
</ul>
</li>
{{ end }}
</ul>
</li>
{{ end }}
</ul>
{{ end }}

View file

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

View file

@ -1,3 +1,9 @@
{{ define "main" }}
{{ partial "results.html" . }}
{{ range first 5 (where .Site.RegularPages "Type" "in" site.Params.mainSections) }}
<article>
<h2><a href="{{ .RelPermalink }}">{{ .Title }}</a></h2>
<p>{{ .Date.Format "Jan 2, 2006" }}</p>
<p>{{ .Summary }}</p>
</article>
{{ end }}
{{ end }}

View file

@ -1,8 +1,6 @@
<!-- <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>
made with <a href="https://gohugo.io">hugo</a>
</small>
<!-- search javascript -->
<script src="/js/search.js"></script>

View file

@ -1,6 +1,5 @@
<header id="banner">
<nav class="navbar">
<div class="nav-left">
<!-- home -->
<a href="{{ .Site.BaseURL }}" class="home">🏠</a>
<!-- menu items -->
@ -9,11 +8,7 @@
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

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

View file

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