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() {
// 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
const otherPages = [{ url: "/en/themes" }];
return [...englishPages, ...otherPages].map((page) => ({
params: {
slug: page.url.slice(4),
@ -17,4 +16,4 @@ export async function getStaticPaths() {
}
---
<meta http-equiv="refresh" content={`0;url=${Astro.props.englishSlug}`} />
<meta http-equiv="refresh" content={`0;url=${Astro.props.englishSlug}`} />