This commit is contained in:
parent
4bc8882620
commit
9fc91d9480
|
|
@ -9,7 +9,12 @@ export default async function Page({
|
||||||
const { slug, locale } = await params
|
const { slug, locale } = await params
|
||||||
const currentLocale = getLocale(locale)
|
const currentLocale = getLocale(locale)
|
||||||
|
|
||||||
console.log(slug, locale)
|
const isReallyProperSlug = /^[a-zA-Z0-9_-]+$/.test(slug)
|
||||||
|
|
||||||
|
if (!isReallyProperSlug) {
|
||||||
|
notFound()
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const path = `@/pages/${currentLocale}/${slug}.mdx`
|
const path = `@/pages/${currentLocale}/${slug}.mdx`
|
||||||
const pagemodule = await import(path)
|
const pagemodule = await import(path)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue