mirror of
https://github.com/ChenQihan666/MyBlog-Next.git
synced 2026-08-14 11:29:33 +08:00
Update contents' path and and href for replaced contents
This commit is contained in:
@@ -16,7 +16,7 @@ export interface Frontmatter {
|
||||
tags: string[];
|
||||
}
|
||||
|
||||
const posts = await Astro.glob<Frontmatter>("../pages/posts/*.md");
|
||||
const posts = await Astro.glob<Frontmatter>("../contents/*.md");
|
||||
|
||||
const sortedPosts = getSortedPosts(posts);
|
||||
---
|
||||
@@ -89,11 +89,11 @@ const sortedPosts = getSortedPosts(posts);
|
||||
<ul>
|
||||
{
|
||||
posts.map(
|
||||
(post) =>
|
||||
post.frontmatter.featured && (
|
||||
({ frontmatter }) =>
|
||||
frontmatter.featured && (
|
||||
<Card
|
||||
href={post.url}
|
||||
post={post.frontmatter}
|
||||
href={`/posts/${frontmatter.slug}`}
|
||||
post={frontmatter}
|
||||
secHeading={false}
|
||||
/>
|
||||
)
|
||||
@@ -107,11 +107,11 @@ const sortedPosts = getSortedPosts(posts);
|
||||
<ul>
|
||||
{
|
||||
sortedPosts.map(
|
||||
(post, index) =>
|
||||
({ frontmatter }, index) =>
|
||||
index < 4 && (
|
||||
<Card
|
||||
href={post.url}
|
||||
post={post.frontmatter}
|
||||
href={`/posts/${frontmatter.slug}`}
|
||||
post={frontmatter}
|
||||
secHeading={false}
|
||||
/>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user