import sitemap from '@astrojs/sitemap'
import type { AstroIntegration } from 'astro'
import autoImport from 'astro-auto-import'
-import type { Element } from 'hast'
+import type { Element, Text } from 'hast'
import rehypeAutolinkHeadings from 'rehype-autolink-headings'
import { getConfig } from './config'
import { rehypeBsTable } from './rehype'
{
behavior: 'append',
content: [{ type: 'text', value: ' ' }],
- properties: { class: 'anchor-link' },
+ properties: (element: Element) => ({
+ class: 'anchor-link',
+ ariaLabel: `Link to this section: ${(element.children[0] as Text).value}`
+ }),
test: (element: Element) => element.tagName.match(headingsRangeRegex)
}
],