Referencing the discussion from #94: Some users may prefer to have trailing slashes stripped from search result links to match their preferred route formatting in Astro.
Pagefind has a processResult UI config option that accepts a function for rewriting search results before rendering them. But since the props to this integration's Search component are JSON-serialized, this function can't be passed.
This PR adds an optional stripTrailingSlash prop for the Search component. If "true", trailing slashes in the search results are stripped.
It also adds that option to the example Main.layout.
Referencing the discussion from #94: Some users may prefer to have trailing slashes stripped from search result links to match their preferred route formatting in Astro.
Pagefind has a
processResult
UI config option that accepts a function for rewriting search results before rendering them. But since the props to this integration's Search component are JSON-serialized, this function can't be passed.This PR adds an optional
stripTrailingSlash
prop for the Search component. If"true"
, trailing slashes in the search results are stripped.It also adds that option to the example Main.layout.