Rename [slug].astro to [...slug].astro (#2306)

This commit is contained in:
Fred K. Schott 2022-01-04 09:10:27 -08:00 committed by GitHub
parent e5019271a5
commit c80c7f677c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,11 +1,10 @@
--- ---
export async function getStaticPaths() { export async function getStaticPaths() {
// get english pages that moved from `/` to `/en/` // get english pages that moved from `/` to `/en/`
const englishPages = Astro.fetchContent('./en/**.md'); const englishPages = Astro.fetchContent('./en/**/*.md');
// add pages that are `*.astro` files as well // add pages that are `*.astro` files as well
const otherPages = [{ url: "/en/themes" }]; const otherPages = [{ url: "/en/themes" }];
return [...englishPages, ...otherPages].map((page) => ({ return [...englishPages, ...otherPages].map((page) => ({
params: { params: {
slug: page.url.slice(4), slug: page.url.slice(4),