Skip to content

Commit a9fa192

Browse files
committed
feat: improve accessibility and add AI resources to footer
- Add proper ARIA attributes to dropdown menu * aria-expanded, aria-haspopup for toggle button * role='menu' for dropdown container * role='menuitem' for each action button - Add AI Resources section to footer with llms.txt links * Link to /llms.txt (54KB) * Link to /llms-full.txt (861KB)
1 parent 061109f commit a9fa192

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

docusaurus.config.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,19 @@ const config = {
235235
},
236236
],
237237
},
238+
{
239+
title: "AI Resources",
240+
items: [
241+
{
242+
label: "llms.txt",
243+
href: "/llms.txt",
244+
},
245+
{
246+
label: "llms-full.txt",
247+
href: "/llms-full.txt",
248+
},
249+
],
250+
},
238251
],
239252
copyright: `Copyright © ${new Date().getFullYear()} WordLift srl`,
240253
},

src/theme/DocBreadcrumbs/index.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,13 +142,17 @@ function PageActionsDropdown(): ReactNode {
142142
gap: '4px',
143143
color: '#ffffff',
144144
}}
145-
aria-label="AI Actions"
145+
aria-label="AI Actions menu"
146+
aria-expanded={isOpen}
147+
aria-haspopup="menu"
146148
>
147149
AI ▾
148150
</button>
149151

150152
{isOpen && (
151153
<div
154+
role="menu"
155+
aria-label="AI Actions"
152156
style={{
153157
position: 'absolute',
154158
right: 0,
@@ -163,6 +167,7 @@ function PageActionsDropdown(): ReactNode {
163167
}}
164168
>
165169
<button
170+
role="menuitem"
166171
onClick={copyPageLink}
167172
style={{
168173
width: '100%',
@@ -181,6 +186,7 @@ function PageActionsDropdown(): ReactNode {
181186
🔗 Copy page link
182187
</button>
183188
<button
189+
role="menuitem"
184190
onClick={viewMarkdown}
185191
style={{
186192
width: '100%',
@@ -199,6 +205,7 @@ function PageActionsDropdown(): ReactNode {
199205
📄 View Page as Markdown
200206
</button>
201207
<button
208+
role="menuitem"
202209
onClick={openInChatGPT}
203210
style={{
204211
width: '100%',

0 commit comments

Comments
 (0)