Links and GET forms to wiki pages swap the next page into .shell instead of loading a new document: the server answers boosted requests and history restores with a partial (title, page actions out-of-band, shell content). The header stays, browsers without cross-document view transitions (Firefox) no longer flash between pages, and the swap runs as a same-document view transition. Files, the editor, internal endpoints and POST forms still navigate normally. Back/Forward refetch pages (no snapshots that could predate a move or delete); the tree rail keeps its scroll position and the content column returns to where it was. Mutation redirects swap their result in the same way. Page scripts that assumed a fresh document now also run after a swap (toc, contents, companion, scroll-sync, search actions) or register once (fitness). The e2e suite now also runs in Firefox. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
50 lines
1.7 KiB
HTML
50 lines
1.7 KiB
HTML
{{define "searchQuery"}}{{.Query}}{{end}}
|
|
|
|
{{define "content"}}
|
|
{{if .Query}}
|
|
{{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 “{{.Query}}” — <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}}
|
|
<article class="search-card">
|
|
<a href="{{.URL}}">{{.Name}}</a>
|
|
<div class="muted">/{{.Path}}</div>
|
|
</article>
|
|
{{end}}
|
|
{{end}}
|
|
{{if .Files}}
|
|
<h2 class="search-section">Matching Files <span class="muted">{{.FileTotal}}</span></h2>
|
|
{{range .Files}}
|
|
<article class="search-card">
|
|
<div class="row">
|
|
{{fileIcon .Name}}
|
|
<a href="{{.URL}}">{{.Name}}</a>
|
|
<button class="btn btn-small" data-companion-file-reveal="{{.Path}}" hidden title="Open location in file manager">open</button>
|
|
</div>
|
|
<div class="muted">/{{.Path}} · {{.Meta}}</div>
|
|
</article>
|
|
{{end}}
|
|
{{end}}
|
|
{{else}}
|
|
<p class="empty">Enter a query above.</p>
|
|
{{end}}
|
|
{{end}}
|
|
|
|
{{define "headerActions"}}
|
|
<button class="btn btn-block" onclick="rebuildIndex()" title="Rebuild search index"><span class="btn-icon">{{icon "rebuild"}}</span><span class="btn-label">REBUILD INDEX</span></button>
|
|
{{end}}
|
|
|
|
{{define "footerExtras"}}
|
|
{{if not .IndexBuiltAt.IsZero}}<span class="muted">· Index: {{.IndexBuiltAt.Format "2006-01-02 15:04"}}</span>{{end}}
|
|
{{end}}
|