Skip to content

Commit 9ab632d

Browse files
authored
Merge pull request #348 from ocruze/feat/links-id-for-analytics
feat: add id on anchor tags for analytics
2 parents f0fc0a2 + 38ba640 commit 9ab632d

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/Footer.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,7 @@ export const Footer = memo(
341341
target="_blank"
342342
href={`https://${domain}`}
343343
title={`${domain} - ${t("open new window")}`}
344+
id={`footer-${domain.replace(/\./g, "-")}-link`}
344345
>
345346
{domain}
346347
</a>
@@ -558,6 +559,7 @@ const { useTranslation, addFooterTranslations } = createComponentI18nApi({
558559
href={p.licenseUrl}
559560
target="_blank"
560561
title="licence etalab-2.0 - ouvre une nouvelle fenêtre"
562+
id="footer-etalab-licence-link"
561563
>
562564
licence etalab-2.0
563565
</a>

src/SkipLinks.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export type SkipLinksProps = {
1313
links: {
1414
label: string;
1515
anchor: string;
16+
id?: string;
1617
}[];
1718
classes?: Partial<Record<"root" | "list" | "link", string>>;
1819
style?: CSSProperties;
@@ -46,6 +47,7 @@ export const SkipLinks = memo(
4647
<a
4748
className={cx(fr.cx("fr-link"), classes.link)}
4849
href={link.anchor}
50+
id={link.id}
4951
>
5052
{link.label}
5153
</a>

0 commit comments

Comments
 (0)