diff --git a/src/pages/index.astro b/src/pages/index.astro index 94d2b2f04..5207646c2 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -10,7 +10,7 @@ import slugify from "@utils/slugify"; import type { Frontmatter } from "src/types"; import Socials from "@components/Socials.astro"; -const posts = await Astro.glob("../contents/*.md"); +const posts = await Astro.glob("../contents/**/*.md"); const sortedPosts = getSortedPosts(posts); --- diff --git a/src/pages/posts/[slug].astro b/src/pages/posts/[slug].astro index 9d0384c9c..998d68eb6 100644 --- a/src/pages/posts/[slug].astro +++ b/src/pages/posts/[slug].astro @@ -28,7 +28,7 @@ type PagePaths = { }[]; export async function getStaticPaths() { - const posts = await Astro.glob("../../contents/*.md"); + const posts = await Astro.glob("../../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("../../contents/*.md"); +const posts = await Astro.glob("../../contents/**/*.md"); const sortedPosts = getSortedPosts(posts); diff --git a/src/pages/posts/index.astro b/src/pages/posts/index.astro index 7583f76e7..ecab9774e 100644 --- a/src/pages/posts/index.astro +++ b/src/pages/posts/index.astro @@ -5,7 +5,7 @@ import getSortedPosts from "@utils/getSortedPosts"; import getPageNumbers from "@utils/getPageNumbers"; import type { Frontmatter } from "src/types"; -const posts = await Astro.glob("../../contents/*.md"); +const posts = await Astro.glob("../../contents/**/*.md"); const sortedPosts = getSortedPosts(posts); diff --git a/src/pages/rss.xml.ts b/src/pages/rss.xml.ts index d6c3aedae..d3879779a 100644 --- a/src/pages/rss.xml.ts +++ b/src/pages/rss.xml.ts @@ -5,7 +5,7 @@ import type { MarkdownInstance } from "astro"; import slugify from "@utils/slugify"; const postImportResult = import.meta.glob>( - "../contents/*.md", + "../contents/**/**/*.md", { eager: true, } diff --git a/src/pages/search.astro b/src/pages/search.astro index 7bca60198..9ebc2809d 100644 --- a/src/pages/search.astro +++ b/src/pages/search.astro @@ -8,7 +8,7 @@ import Search from "@components/Search"; import type { Frontmatter } from "src/types"; // Retrieve all articles -const posts = await Astro.glob("../contents/*.md"); +const posts = await Astro.glob("../contents/**/*.md"); // List of items to search in const searchList = posts diff --git a/src/pages/tags/[tag].astro b/src/pages/tags/[tag].astro index dbf9fb985..cccd98c50 100644 --- a/src/pages/tags/[tag].astro +++ b/src/pages/tags/[tag].astro @@ -18,7 +18,7 @@ export interface Props { export async function getStaticPaths() { const posts: MarkdownInstance[] = await Astro.glob( - "../../contents/*.md" + "../../contents/**/*.md" ); const tags = getUniqueTags(posts); @@ -38,7 +38,7 @@ export async function getStaticPaths() { const { tag } = Astro.props; const posts: MarkdownInstance[] = await Astro.glob( - "../../contents/*.md" + "../../contents/**/*.md" ); const tagPosts = getPostsByTag(posts, tag); diff --git a/src/pages/tags/index.astro b/src/pages/tags/index.astro index 176f83878..d10310b32 100644 --- a/src/pages/tags/index.astro +++ b/src/pages/tags/index.astro @@ -8,7 +8,7 @@ import Tag from "@components/Tag.astro"; import getUniqueTags from "@utils/getUniqueTags"; import type { Frontmatter } from "src/types"; -const posts = await Astro.glob("../../contents/*.md"); +const posts = await Astro.glob("../../contents/**/*.md"); let tags = getUniqueTags(posts); ---