chore: shorten the links of tracking events

This commit is contained in:
Stefan Imhoff
2024-09-28 20:43:32 +02:00
parent b620e588b6
commit bef58c04ca

View File

@@ -13,7 +13,7 @@ const isExternal = (href as string).startsWith('http');
<a
class:list={['link', { external: isExternal }, className]}
data-umami-event={isExternal ? `Link: ${href}` : undefined}
data-umami-event={isExternal ? `Link: ${href.replace(/^(https?:\/\/)/, '')}` : undefined}
href={href}
rel={isExternal ? 'nofollow noopener noreferrer' : undefined}
target={isExternal ? '_blank' : undefined}