mirror of
https://github.com/ChenQihan666/MyBlog-Next.git
synced 2026-08-14 19:41:02 +08:00
Change glob
This commit is contained in:
@@ -28,7 +28,7 @@ type PagePaths = {
|
||||
}[];
|
||||
|
||||
export async function getStaticPaths() {
|
||||
const posts = await Astro.glob<Frontmatter>("../../contents/*.md");
|
||||
const posts = await Astro.glob<Frontmatter>("../../contents/**/*.md");
|
||||
|
||||
let postResult: PostResult = posts.map((post) => {
|
||||
return {
|
||||
@@ -51,7 +51,7 @@ export async function getStaticPaths() {
|
||||
const { slug } = Astro.params;
|
||||
const { post } = Astro.props;
|
||||
|
||||
const posts = await Astro.glob<Frontmatter>("../../contents/*.md");
|
||||
const posts = await Astro.glob<Frontmatter>("../../contents/**/*.md");
|
||||
|
||||
const sortedPosts = getSortedPosts(posts);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user