Open mattiasJohnson opened 2 months ago
Hi @mattiasJohnson 👋
That setup should just work. Pagefind operates on absolute URLs generally, which means:
static
, containing a about/index.html
file (so static/about/index.html
in full)
/about/
https://example.com/
and a search result returns that page
/about/
In other words, when indexing, all URLs are indexed as absolute URLs relative to the input folder. When searching, the default assumption is that those URLs exist on the current website.
Hopefully that helps explain things — let me know if you're seeing something different, though!
Same use case here as OP, using Astro server side rendering.
A general solution could be to create a static folder by spidering a locally hosted version and then have Pagefind generate an index off of that.
I would like to include pagefind for an older website which is not static but is using ASP.NET MVC. During the build process of the website I would have no problem generating a folder structure which would be like a static version of the website to use for the indexing. The problem would be to ensure that the links in the search results lead to the actual pages and not to these static files (which I would prefer not to even have to host, just use during build process).
Could someone give some pointers on what I would need to change to have the search results lead to the correct page? (they would of course have the same naming structure so a search result for a static file /documentation/apishould lead to mywebsite.com/documentation/api)