mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-07-21 06:21:17 -04:00
custom <Link />
wrapper around next/link
This commit is contained in:
@@ -5,10 +5,15 @@ import styles from "./NoteTitle.module.css";
|
||||
|
||||
type Props = Pick<NoteMetaType, "slug" | "htmlTitle">;
|
||||
|
||||
const NoteTitle = ({ slug, htmlTitle }: Props) => (
|
||||
const NoteTitle = ({ slug, htmlTitle, ...rest }: Props) => (
|
||||
<h1 className={styles.title}>
|
||||
<Link href={`/notes/${slug}/`}>
|
||||
<a dangerouslySetInnerHTML={{ __html: htmlTitle }} />
|
||||
<Link
|
||||
href={{
|
||||
pathname: "/notes/[slug]/",
|
||||
query: { slug: slug },
|
||||
}}
|
||||
>
|
||||
<a dangerouslySetInnerHTML={{ __html: htmlTitle }} {...rest} />
|
||||
</Link>
|
||||
</h1>
|
||||
);
|
||||
|
Reference in New Issue
Block a user