You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
The text was updated successfully, but these errors were encountered:
That setup should just work. Pagefind operates on absolute URLs generally, which means:
If pointed at a folder of static files named static, containing a about/index.html file (so static/about/index.html in full)
Pagefind will assign that file the URL /about/
If that search index is then hosted on https://example.com/ and a search result returns that page
Pagefind will output the URL as /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!
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)
The text was updated successfully, but these errors were encountered: