Skip to content
This repository was archived by the owner on Feb 27, 2024. It is now read-only.

Commit 21e692f

Browse files
committed
Add post links
1 parent 55f23de commit 21e692f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pages/posts/[[...slug]].js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {Info} from '@/components/molecules/Alert'
33
import PropTypes from 'prop-types'
44
import getPostTypeStaticPaths from '@/api/wordpress/_global/getPostTypeStaticPaths'
55
import getPostTypeStaticProps from '@/api/wordpress/_global/getPostTypeStaticProps'
6+
import Link from 'next/link'
67

78
// Define route post type.
89
const postType = 'post'
@@ -28,7 +29,11 @@ export default function BlogPost({post, posts, archive}) {
2829
posts.map((post, index) => (
2930
<>
3031
<article key={index}>
31-
<h1 dangerouslySetInnerHTML={{__html: post?.title}} />
32+
<Link href={post.uri}>
33+
<a>
34+
<h1 dangerouslySetInnerHTML={{__html: post?.title}} />
35+
</a>
36+
</Link>
3237
<div dangerouslySetInnerHTML={{__html: post?.excerpt}} />
3338
</article>
3439
<hr />

0 commit comments

Comments
 (0)