yufan.me/src/pages/[slug].astro
2024-06-14 02:11:26 +08:00

17 lines
285 B
Plaintext

---
import { getPage } from '@/helpers/schema';
import PageLayout from '@/layouts/PageLayout.astro';
const { slug } = Astro.params;
if (!slug) {
return Astro.redirect('/404');
}
const page = getPage(slug);
if (!page) {
return Astro.redirect('/404');
}
---
<PageLayout {page} />