Skip to content

Commit 1b62ef8

Browse files
committed
fix: next prev post title
1 parent 395dfa2 commit 1b62ef8

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

src/pages/blog/[slug].astro

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ export async function getStaticPaths() {
2121
async function getPostTitleFromId(id) {
2222
try {
2323
if (!id) return null;
24-
const post = await getEntry("posts", id);
25-
return post.data.title;
24+
const data = await getEntry("data", id);
25+
return data.data.title;
2626
} catch (e) {
2727
return null;
2828
}
@@ -31,15 +31,6 @@ async function getPostTitleFromId(id) {
3131
const { post, data } = Astro.props;
3232
const { title, slug, description, publishDate, tags, prevPost, nextPost } =
3333
data;
34-
console.log({
35-
title,
36-
slug,
37-
description,
38-
publishDate,
39-
tags,
40-
prevPost,
41-
nextPost,
42-
});
4334
const readingTimeEstimate = readingTime(post.body).text;
4435
const permalink = `${Astro.site.href}blog/${slug}`;
4536

0 commit comments

Comments
 (0)