1
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:
2022-02-15 12:59:54 -05:00
parent a47d49c0d5
commit 67d98124f6
4 changed files with 163 additions and 154 deletions

View File

@ -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>
);