Skip to content

Commit 44f2402

Browse files
committed
i18n support for search
1 parent 71ecfd3 commit 44f2402

File tree

4 files changed

+10
-155
lines changed

4 files changed

+10
-155
lines changed

src/pages/en/search-index.astro

Lines changed: 0 additions & 51 deletions
This file was deleted.

src/pages/es/search-index.astro

Lines changed: 0 additions & 51 deletions
This file was deleted.

src/pages/search-index.astro

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,16 @@ changeLanguage("en")
88
// import .astro files
99
const pages = await Astro.glob("./**/*.astro")
1010
// import .md files
11-
const posts = [...(await Astro.glob("../content/docs/en/**/*.md")).filter((post) => !post.frontmatter.draft)]
12-
const postsMdx = [...(await Astro.glob("../content/docs/en/**/*.mdx")).filter((post) => !post.frontmatter.draft)]
11+
const posts = [
12+
...(await Astro.glob("../content/docs/en/**/*.md")),
13+
...(await Astro.glob("../content/docs/es/**/*.md")),
14+
...(await Astro.glob("../content/docs/zh/**/*.md")),
15+
].filter((post) => !post.frontmatter.draft)
16+
const postsMdx = [
17+
...(await Astro.glob("../content/docs/en/**/*.mdx")),
18+
...(await Astro.glob("../content/docs/es/**/*.mdx")),
19+
...(await Astro.glob("../content/docs/zh/**/*.mdx")),
20+
].filter((post) => !post.frontmatter.draft)
1321
const postsMdxWithContent = postsMdx.map((post) => {
1422
const url = new URL(post.file, import.meta.url)
1523
const content = fs.readFileSync(url, "utf-8")

src/pages/zh/search-index.astro

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)