Exact page matches in search

This commit is contained in:
2026-07-20 09:08:35 +02:00
parent 5303645173
commit 34f750beff
3 changed files with 80 additions and 7 deletions
+11 -4
View File
@@ -4,7 +4,17 @@
{{define "content"}}
{{if .Query}}
{{if or .Pages .Files}}
{{if .Exact}}
<h2 class="search-section">Exact Match</h2>
{{range .Exact}}
<article class="search-card">
<a href="{{.URL}}">{{.Name}}</a>
<div class="muted">/{{.Path}}</div>
</article>
{{end}}
{{else}}
<p class="muted">No page named &ldquo;{{.Query}}&rdquo;<button class="btn btn-small" data-create-page="{{.Query}}">create it</button></p>
{{end}}
{{if .Pages}}
<h2 class="search-section">Matching Pages <span class="muted">{{.PageTotal}}</span></h2>
{{range .Pages}}
@@ -27,9 +37,6 @@
</article>
{{end}}
{{end}}
{{else}}
<p class="empty">No matches for &ldquo;{{.Query}}&rdquo;.</p>
{{end}}
{{else}}
<p class="empty">Enter a query above.</p>
{{end}}