-
Notifications
You must be signed in to change notification settings - Fork 178
Description
Hi! I'm using pagefind with the default UI.
I wanted to use the feature to override the URL of a result exactly like described in the docs. It only worked for the main result, but all of the subresults still use their original URLs.
I believe this is the relevant code snippet: the result link uses data.meta?.url, but the subresult link does not.
pagefind/pagefind_ui/default/svelte/result_with_subs.svelte
Lines 62 to 73 in 405b7d9
| <a class="pagefind-ui__result-link" href={data.meta?.url || data.url} | |
| >{data.meta?.title}</a | |
| > | |
| </p> | |
| {#if has_root_sub_result} | |
| <p class="pagefind-ui__result-excerpt">{@html data.excerpt}</p> | |
| {/if} | |
| {#each non_root_sub_results as subres} | |
| <div class="pagefind-ui__result-nested"> | |
| <p class="pagefind-ui__result-title"> | |
| <a class="pagefind-ui__result-link" href={subres.url} |
The way I expected this feature to work is that I would be overwriting the URL for the whole page, including the sub results. For example, if I had the page with the URL /tutorial.html and I chose to overwrite it to https://my-app.com/docs/tutorial, I expected all the subresults to get overwritten from /tutorial.html#some-heading to https://my-app.com/docs/tutorial#some-heading etc.
Is this a bug, or are my expectations wrong? Is there a way to overwrite URLs of subresults too?