chore: add more umami event links

This commit is contained in:
Stefan Imhoff
2024-09-13 20:00:49 +02:00
parent 63b0f69772
commit 81051c919f
6 changed files with 8 additions and 3 deletions

View File

@@ -15,9 +15,10 @@ const amazonImageUrl = `https://images-na.ssl-images-amazon.com/images/P/${asin}
--- ---
<Link <Link
href={`https://www.amazon.de/gp/product/${asin}`}
class={className}
aria-label={alt} aria-label={alt}
class={className}
data-umami-event={`Book: ${asin}`}
href={`https://www.amazon.de/gp/product/${asin}`}
{...props} {...props}
> >
<Book alt={alt} src={amazonImageUrl} /> <Book alt={alt} src={amazonImageUrl} />

View File

@@ -11,7 +11,7 @@ interface Props {
const { href, text, ...props } = Astro.props; const { href, text, ...props } = Astro.props;
--- ---
<TextLink class="group" href={href} {...props}> <TextLink class="group" href={href} data-umami-event={`Download: ${text}`} {...props}>
{text} {text}
<span class="more-icon relative inline-flex mis-[0.2em] block-start-[0.2em]"> <span class="more-icon relative inline-flex mis-[0.2em] block-start-[0.2em]">
<Download <Download

View File

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

View File

@@ -16,6 +16,7 @@ const { class: className, id, ...props } = Astro.props;
'rounded-1 border-1 border-solid border-red-600 bg-red-600 font-mono text-[0.7em] text-white decoration-0 pli-[0.3em] pbe-0 pbs-[0.1em] print:border-gray-500 print:bg-transparent', 'rounded-1 border-1 border-solid border-red-600 bg-red-600 font-mono text-[0.7em] text-white decoration-0 pli-[0.3em] pbe-0 pbs-[0.1em] print:border-gray-500 print:bg-transparent',
className, className,
]} ]}
data-umami-event={`Netflix: ${id}`}
href={`https://www.netflix.com/title/${id}`} href={`https://www.netflix.com/title/${id}`}
title="Netflix" title="Netflix"
{...props} {...props}

View File

@@ -16,6 +16,7 @@ const { class: className, id, ...props } = Astro.props;
'rounded-1 border-1 border-solid border-sky-500 bg-sky-500 font-mono text-[0.7em] text-white decoration-0 pli-[0.3em] pbe-0 pbs-[0.1em] print:border-gray-500 print:bg-transparent', 'rounded-1 border-1 border-solid border-sky-500 bg-sky-500 font-mono text-[0.7em] text-white decoration-0 pli-[0.3em] pbe-0 pbs-[0.1em] print:border-gray-500 print:bg-transparent',
className, className,
]} ]}
data-umami-event={`PrimeVideo: ${id}`}
href={`https://www.amazon.de/gp/video/detail/${id}`} href={`https://www.amazon.de/gp/video/detail/${id}`}
title="Prime Video" title="Prime Video"
{...props} {...props}

View File

@@ -14,6 +14,7 @@ const { asin, class: className, text, ...props } = Astro.props;
<TextLink <TextLink
class:list={['product', className]} class:list={['product', className]}
data-umami-event={`Product: ${asin}`}
href={`https://www.amazon.de/gp/product/${asin}`} href={`https://www.amazon.de/gp/product/${asin}`}
{...props} {...props}
> >