0d24df31addf4484629ea9c402ad4d70ceeed62d
Remove the legacy Fuse.js search from html-head.html (it double-loaded
with the new Pagefind UI; backup kept at html-head.html.bkup) and add a
Pagefind Default-UI partial (search.html) injected into the sidebar via
menu.html.
Index scoping: tag the article element with data-pagefind-body in
baseof.html, term.html, and posts/{single,list}.html so Pagefind indexes
page content only (pages without the tag are skipped; 404.html stays
untagged).
search.html (all overrides #search-scoped, since pagefind-ui.css loads in
<body> after the head CSS):
- compact input/magnifier/clear-button fitted to the sidebar; clear
button uses fixed px (not %) because the results drawer is an in-flow
child of the form, which stretches the form to results height
- hide the empty .result-thumb placeholder (no images in the index) that
was pushing result text ~90px right
- restyle matched-term <mark> from UA yellow to subdued slate
- keyboard navigation (Pagefind 1.5.2 has none; stock Enter is a silent
no-op): capture-phase keydown implements ArrowUp/Down highlighting with
wraparound across top-level hits AND their nested sub-results (each sub
highlights its own .result-nested row), Enter opens the highlighted
result (or the top result), and a fingerprint-aware MutationObserver
keeps the highlight across Pagefind's async re-renders without
resetting it on every DOM patch
Building The Website
Clone Repository
git clone https://dev.libertytools.io/adminuser/libertytoolsio.git
Run Makefile
The Makefile in the root of the directory will run the following two commands:
hugo server &
npx -y pagefind --site public --serve
The first command will run and compile the hugo website and any changes made. The second command will build and re-index the search bar index.
To build the website, simply run
make run
in the project root to run those two commands found in the Makefile.
Viewing Changes to Website Locally
After running the Makefile you should get an output like this"
hugo server &
npx -y pagefind --site public --serve
Watching for changes in /path/to/libertytools_sites/dev_lt/libertytoolsio/{archetypes,content,data,layouts,static,themes}
Watching for config changes in /path/to/libertytools_sites/dev_lt/libertytoolsio/config.toml, /path/to/libertytools_sites/dev_lt/libertytoolsio/themes/hugo-book/hugo.toml
Start building sites …
hugo v0.151.0-c70ab27ceb841fc9404eab5d2c985ff7595034b7+extended linux/amd64 BuildDate=2025-10-02T13:30:36Z VendorInfo=gohugoio
│ EN
──────────────────┼─────
Pages │ 27
Paginator pages │ 0
Non-page files │ 65
Static files │ 106
Processed images │ 0
Aliases │ 0
Cleaned │ 0
Built in 100 ms
Environment: "development"
Serving pages from disk
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stop
Running Pagefind v1.5.2 (Extended)
Running from: "/path/to/libertytools_sites/dev_lt/libertytoolsio"
Source: "public"
Output: "public/pagefind"
[Walking source directory]
Found 50 files matching **/*.{html}
[Parsing files]
Did not find a data-pagefind-body element on the site.
↳ Indexing all <body> elements on the site.
[Reading languages]
Discovered 2 languages: en-us, en
[Building search indexes]
Total:
Indexed 2 languages
Indexed 48 pages
Indexed 6934 words
Indexed 0 filters
Indexed 0 sorts
┌─────────────────────────────────────────────────────────────────────────┐
│ Pagefind found references to the Default UI (pagefind-ui.js) │
│ on your site. The Default UI is supported and will continue │
│ to work. │
│ │
│ As of 1.5.0, if you are setting up a new integration, use the │
│ Component UI instead. It includes a search modal, better │
│ accessibility and customization: https://pagefind.app/docs/search-ui/ │
└─────────────────────────────────────────────────────────────────────────┘
Finished in 0.067 seconds
Serving the Pagefind Playground at http://localhost:1414/pagefind/playground/
Serving "public" at http://localhost:1414
Copy http://localhost:1414 into your web browser and you should then see the website as it is with all the changes made, but only served from your local machine. This version of the site is not public facing.
Languages
HTML
35.2%
CSS
33.7%
SCSS
16.9%
Python
6.4%
JavaScript
3.9%
Other
3.9%