getResultSiteRelativeLink

Function

Determines the canonical siteRelative link for a search result.

We need to pass in site specifically for Hub Page items. Unfortunately for us, Hub Page items have their canonical slug stored in the corresponding site's data.json, not within the Hub Page item itself.

NOTE: The slugs generated by indexer for Hub Page items are not canonical and should not be used for link generation.

Parameters

Parameter Type Default Notes

Returns

a canonical siteRelative link

string

Function defined in common/src/search/utils.ts:337