properly set hrefs for dynamic paths on notes list

This commit is contained in:
2022-01-07 08:56:37 -05:00
parent 3528707e52
commit 34d2304e7c
6 changed files with 117 additions and 125 deletions
+7 -1
View File
@@ -22,7 +22,13 @@ const List = ({ notesByYear }) => {
<li key={note.slug} className={styles.row}>
<span className={styles.date}>{format(new Date(note.date), "MMM d")}</span>
<span>
<Link href={`/notes/${note.slug}/`} prefetch={false}>
<Link
href={{
pathname: "/notes/[slug]/",
query: { slug: note.slug },
}}
prefetch={false}
>
<a>
<Markdown options={{ disableParsingRawHTML: true, forceInline: true }}>{note.title}</Markdown>
</a>