First iteration of blog
GitHub Pages / deploy (push) Has been cancelled
GitHub Pages / build (push) Has been cancelled

This commit is contained in:
2024-10-14 00:18:50 -05:00
parent 336b7b579a
commit 081f5b1f67
112 changed files with 18927 additions and 124 deletions
+23
View File
@@ -0,0 +1,23 @@
/* eslint-disable jsx-a11y/anchor-has-content */
import Link from 'next/link'
import type { LinkProps } from 'next/link'
import { AnchorHTMLAttributes } from 'react'
const CustomLink = ({ href, ...rest }: LinkProps & AnchorHTMLAttributes<HTMLAnchorElement>) => {
const isInternalLink = href && href.startsWith('/')
const isAnchorLink = href && href.startsWith('#')
if (isInternalLink) {
return <Link className="break-words" href={href} {...rest} />
}
if (isAnchorLink) {
return <a className="break-words" href={href} {...rest} />
}
return (
<a className="break-words" target="_blank" rel="noopener noreferrer" href={href} {...rest} />
)
}
export default CustomLink