Remove unnessary links
There is no need to link to the image we are already viewing and this is also considered an accessibility issue.
@@ -88,10 +88,16 @@ const Image = ({ src, alt, title, href, ...props }) => {
const markdownComponents = { code: InlineCode, p: Fragment, a: Link }
return (
<figure className="gatsby-resp-image-figure">
- <Link className={linkClassNames} href={href ?? src} hidden forceExternal>
+ {href ? (
+ <Link className={linkClassNames} href={href} hidden forceExternal>
{/* eslint-disable-next-line @next/next/no-img-element */}
<img className={classes.image} src={src} alt={alt} width={650} height="auto" />
</Link>
+ ) : (
+ /* eslint-disable-next-line @next/next/no-img-element */
+ <img className={classes.image} src={src} alt={alt} width={650} height="auto" />
+ )}
+
{title && (
<figcaption className="gatsby-resp-image-figcaption">
<MarkdownToReact markdown={title} />
