From c80c7f677c8ba42efdbd399fd5bf9cf3c191856f Mon Sep 17 00:00:00 2001 From: "Fred K. Schott" Date: Tue, 4 Jan 2022 09:10:27 -0800 Subject: Rename [slug].astro to [...slug].astro (#2306) --- docs/src/pages/[...slug].astro | 19 +++++++++++++++++++ docs/src/pages/[slug].astro | 20 -------------------- 2 files changed, 19 insertions(+), 20 deletions(-) create mode 100644 docs/src/pages/[...slug].astro delete mode 100644 docs/src/pages/[slug].astro (limited to 'docs/src') diff --git a/docs/src/pages/[...slug].astro b/docs/src/pages/[...slug].astro new file mode 100644 index 000000000..613e2b3d5 --- /dev/null +++ b/docs/src/pages/[...slug].astro @@ -0,0 +1,19 @@ +--- +export async function getStaticPaths() { + // get english pages that moved from `/` to `/en/` + const englishPages = Astro.fetchContent('./en/**/*.md'); + + // add pages that are `*.astro` files as well + const otherPages = [{ url: "/en/themes" }]; + return [...englishPages, ...otherPages].map((page) => ({ + params: { + slug: page.url.slice(4), + }, + props: { + englishSlug: page.url, + } + })); +} +--- + + diff --git a/docs/src/pages/[slug].astro b/docs/src/pages/[slug].astro deleted file mode 100644 index 7c08ff268..000000000 --- a/docs/src/pages/[slug].astro +++ /dev/null @@ -1,20 +0,0 @@ ---- -export async function getStaticPaths() { - // get english pages that moved from `/` to `/en/` - const englishPages = Astro.fetchContent('./en/**.md'); - - // add pages that are `*.astro` files as well - const otherPages = [{ url: "/en/themes" }]; - - return [...englishPages, ...otherPages].map((page) => ({ - params: { - slug: page.url.slice(4), - }, - props: { - englishSlug: page.url, - } - })); -} ---- - - \ No newline at end of file -- cgit v1.2.3