mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-06-30 21:46:39 -04:00
enable AVIF images
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
import classNames from "classnames";
|
||||
import innerText from "react-innertext";
|
||||
import type { HTMLAttributes } from "react";
|
||||
|
||||
import styles from "./Heading.module.css";
|
||||
@ -14,7 +15,13 @@ const Heading = ({ as: Component, id, className, children, ...rest }: HeadingPro
|
||||
|
||||
{/* add anchor link to H2s and H3s. ID is already generated by rehype-slug. `#` character inserted via CSS. */}
|
||||
{id && (Component === "h2" || Component === "h3") && (
|
||||
<a className={styles.anchor} href={`#${id}`} tabIndex={-1} aria-hidden={true} />
|
||||
<a
|
||||
className={styles.anchor}
|
||||
href={`#${id}`}
|
||||
title={`Jump to "${innerText(children)}"`}
|
||||
tabIndex={-1}
|
||||
aria-hidden={true}
|
||||
/>
|
||||
)}
|
||||
</Component>
|
||||
);
|
||||
|
Reference in New Issue
Block a user