You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// ./plugins/aria-current-links.jsimport{join}from"node:path";import{visit}from"unist-util-visit";// If the link matches the current page set 'aria-current' to true// <a>...</a> => <a aria-current="true>...</a>exportdefaultfunctionariaCurrentLinks(){const{pageContext: { page },}=this.data();return(tree)=>{visit(tree,["link","linkReference"],(node)=>{consturl=node?.url;if(url&&join(page.filePathStem)!==join(url)){return;}node.data=merge(node.data,{hProperties: {"aria-current": "true",},});});};}
/*** When an link targetting the current page:* - use the body text colour* - show underline on interaction**/
[aria-current="true"] {
color: currentColor;
}
[aria-current="true"]:not(:focus):not(:active):not(:hover) {
text-decoration: none;
}