Add site search (Pagefind)
Client-side index generated after the Hugo build; search box in the header, results page with a section filter. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YDRjtmAiNpo5mK5N3d7QwZ
This commit is contained in:
@@ -29,10 +29,19 @@ banner, date, author and summary (`summary:` in the front matter, or the text be
|
||||
`<!--more-->`, or the first lines); all posts are listed under News. Posts are never touched by
|
||||
`make content`.
|
||||
|
||||
## Search
|
||||
|
||||
Search runs in the visitor's browser on an index generated by [Pagefind](https://pagefind.app/)
|
||||
at the end of `make build` (fetched by `npx`, so Node.js is needed to build). The header box
|
||||
sends to `/search/`, where results can be filtered by section. Content pages are indexed
|
||||
(`data-pagefind-body` on `<main>` in `layouts/baseof.html`); lists, taxonomy pages and the
|
||||
visitor-comments tabs are not. `hugo server` has no index: use `make build` and serve `build/`
|
||||
to try the search locally.
|
||||
|
||||
## Usage
|
||||
|
||||
make content # regenerate from ../oc (OC=path to use another location)
|
||||
make build # build into build/
|
||||
make build # build into build/, with the search index
|
||||
make check # build + verify every internal link and image
|
||||
make serve # preview on http://localhost:1313
|
||||
make deploy # build and copy to the test server (share must be mounted; see DEPLOY_DIR/DEPLOY_URL)
|
||||
|
||||
Reference in New Issue
Block a user