fix: keep navigation labels single and accessible
This commit is contained in:
@@ -25,6 +25,17 @@ const sectionHeadings = [
|
||||
'CONTACT',
|
||||
] as const;
|
||||
|
||||
const navigationLabels: Readonly<Record<(typeof sectionIds)[number], string>> = {
|
||||
start: 'Start',
|
||||
profile: 'Profile',
|
||||
experience: 'Career',
|
||||
infrastructure: 'Infra',
|
||||
'selected-builds': 'Builds',
|
||||
'additional-work': 'More work',
|
||||
toolkit: 'Toolkit',
|
||||
contact: 'Contact',
|
||||
};
|
||||
|
||||
const visibleTextLeafSelector = 'h1,h2,h3,p,dt,dd,li,figcaption,a,svg text';
|
||||
const visibleTextSelector = [
|
||||
'.site-header :is(h1,h2,h3,p,dt,dd,li,figcaption,a)',
|
||||
@@ -96,12 +107,7 @@ const expectedVisibleTextSegments = (
|
||||
return [
|
||||
content.identity.name,
|
||||
content.identity.role,
|
||||
...sectionIds.map((id) => {
|
||||
const label = navigationById.get(id);
|
||||
if (label === undefined)
|
||||
throw new Error(`Missing navigation label: ${id}`);
|
||||
return label;
|
||||
}),
|
||||
...sectionIds.map((id) => navigationLabels[id]),
|
||||
...section('start', 1, [content.identity.valueProposition]),
|
||||
...section('profile', 2, [
|
||||
content.profile.introduction,
|
||||
|
||||
Reference in New Issue
Block a user