blog/layouts/_default/search.html
2025-08-20 15:19:24 +01:00

36 lines
909 B
HTML

{{ 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 }}