31 Oct 2022
Aiming to replace Stork for my Pelican-powered static site. !projects/notes


Asked question regarding support of Github Pages:

Setup
Requires Node.js with npx.
Install from:

Not working with code snippet provided on Pagefind homepage.
Seems like an issue with CSS and JS paths.
Copied .js and .css files to Pelican theme/js and theme/css.
This works (currently Live), ie search input and output appear.. but empty.
404 on https://notes.nicolasdeville.com/_pagefind/pagefind-ui.css (which I should have tried and figured out at the previous step!) - which means the standard Github Actions worfklow triggered by Github Pages does not include the folder when deploying? 🤔
Downloaded the Artifact (ie root folder content of the website on server) from Github Pages, and indeed the folder _pagefind is not included, despite being present in the main Github branch used as source for the default Github Actions workflow that generates Github Pages.
Confirmed that folders prefixed with _ do not get included in the build: https://github/orgs/community/discussions/23640
How to get it included?
Asked: https://github/CloudCannon/pagefind/discussions/126
02 Nov 2022
Working now, using:
npx -y pagefind --source "/Users/USER/path/to/folder/with/html/files" --bundle-dir pagefind
The last pagefind argument defines the name of the folder to be created, overriding the default _pagefind which did not work because Github Pages ignores folders prefixed with _ upon deployment.
output:
.
├── filter
├── fragment
├── index
├── pagefind-entry.json
├── pagefind-ui.css
├── pagefind-ui.js
├── pagefind.en_4dc9564564.pf_meta
├── pagefind.en_8ba44c3efa.pf_meta
├── pagefind.en_a9db73dbfe.pf_meta
├── pagefind.en_eca087938c.pf_meta
├── pagefind.en_fbece7798f.pf_meta
├── pagefind.js
├── wasm.en.pagefind
└── wasm.unknown.pagefind
Next steps:
- exclude folders from search index (eg
author,tag, etc..) - show only sections with results
- show categories without having to expand each
focus: trueon load- navigate results with keyboard
exclude folders from search index
Asked on Github:

05 Mar 2023 been in place and working well since Nov'.
Open
passing a search query via URL parameter
See:

"There's some discussion of this in #144 — it is possible but you'll need a small code snippet of your own to get the query from the URL 🙂"
let pagefind = new PagefindUI({ element: "#search" });
pagefind.triggerSearch("some search terms");
29 Nov 2026
4 years later: how I use it in NicAI
Pagefind has run search on this site since November 2022 without a single replacement. It now runs as step 3 of the publish pipeline that my AI assistant triggers on every note it writes (see !NicAI/notes-pipeline).
What changed in Pagefind:
- Version 1.x. The current release is 1.6.0 (1st November 2026). It added ICU4X segmentation for Chinese, Japanese and Thai, and a
--max-fragmentscap for hosts that limit file counts. - Component UI (1.5.0): a search interface built from web components (search box, modal, result list, filters), next to the classic
PagefindUI.
My setup today:
- Pinned through npm: a
package.jsoninsite/pinspagefind ^1.5.2, and the build runsnpx --no-install pagefind, so a build never pulls an unplanned version. - Config in
pagefind.yml: index every HTML file of the output,force_language: en, and excludeheader#banner,nav, the footer, scripts and anything withdata-pagefind-ignore. - Only the note body counts.
article.htmlwraps the article indata-pagefind-body, so index, tag and category pages are crawled but add no results. The template also addsdata-pagefind-meta(title, date, category),data-pagefind-filter(category) anddata-pagefind-sort(date). - Thumbnails: a small Pelican plugin tags the first content image of each note with
data-pagefind-meta="image[src], image_alt[alt]", so results show a picture. - Boilerplate stays out. The NicAI signature block at the end of generated notes carries
data-pagefind-ignore, so the same sentence doesn't match every query. - Clean rebuild every time. The pipeline deletes the
pagefind/folder before each run: Pagefind appends fragments, and old ones piled up otherwise. - No stale index in browsers: an
.htaccesssetsCache-Control: no-cacheonpagefind-entry.json. - Speed: about 1,300 pages indexed in roughly 1.2 seconds.