Open floehopper opened 2 months ago
In case it helps, I added a little bit of processResult
JavaScript to remove the .html
from the end of the URLs in Pagefind’s search results, since I don’t ordinarily use that when I link to pages (i.e. I have permalink: :title
in my Jekyll config):
<link href="/pagefind/pagefind-ui.css" rel="stylesheet">
<script src="/pagefind/pagefind-ui.js"></script>
<div id="search"></div>
<script>
window.addEventListener('DOMContentLoaded', function () {
new PagefindUI({
element: '#search',
processResult: function (result) {
result.url = result.url.replace(/\.html$/, '');
return result;
}
});
});
</script>
Good luck!
Thanks, @tom!
@threedaymonk & @tomstuart have both used https://pagefind.app/ on their personal sites, so that might be worth a try.