diff --git a/templates/website/src/app/(frontend)/[slug]/page.tsx b/templates/website/src/app/(frontend)/[slug]/page.tsx index 8ab6ec717b1..d83339187a0 100644 --- a/templates/website/src/app/(frontend)/[slug]/page.tsx +++ b/templates/website/src/app/(frontend)/[slug]/page.tsx @@ -46,6 +46,7 @@ type Args = { } export default async function Page({ params: paramsPromise }: Args) { + const { isEnabled: draft } = await draftMode() const { slug = 'home' } = await paramsPromise const url = '/' + slug @@ -72,7 +73,7 @@ export default async function Page({ params: paramsPromise }: Args) { {/* Allows redirects for valid pages too */} - + {draft && } diff --git a/templates/website/src/app/(frontend)/posts/[slug]/page.tsx b/templates/website/src/app/(frontend)/posts/[slug]/page.tsx index 63f805713be..ab6ab19a31f 100644 --- a/templates/website/src/app/(frontend)/posts/[slug]/page.tsx +++ b/templates/website/src/app/(frontend)/posts/[slug]/page.tsx @@ -42,6 +42,7 @@ type Args = { } export default async function Post({ params: paramsPromise }: Args) { + const { isEnabled: draft } = await draftMode() const { slug = '' } = await paramsPromise const url = '/posts/' + slug const post = await queryPostBySlug({ slug }) @@ -55,7 +56,7 @@ export default async function Post({ params: paramsPromise }: Args) { {/* Allows redirects for valid pages too */} - + {draft && } diff --git a/templates/with-vercel-website/src/app/(frontend)/[slug]/page.tsx b/templates/with-vercel-website/src/app/(frontend)/[slug]/page.tsx index 8ab6ec717b1..d83339187a0 100644 --- a/templates/with-vercel-website/src/app/(frontend)/[slug]/page.tsx +++ b/templates/with-vercel-website/src/app/(frontend)/[slug]/page.tsx @@ -46,6 +46,7 @@ type Args = { } export default async function Page({ params: paramsPromise }: Args) { + const { isEnabled: draft } = await draftMode() const { slug = 'home' } = await paramsPromise const url = '/' + slug @@ -72,7 +73,7 @@ export default async function Page({ params: paramsPromise }: Args) { {/* Allows redirects for valid pages too */} - + {draft && } diff --git a/templates/with-vercel-website/src/app/(frontend)/posts/[slug]/page.tsx b/templates/with-vercel-website/src/app/(frontend)/posts/[slug]/page.tsx index 63f805713be..ab6ab19a31f 100644 --- a/templates/with-vercel-website/src/app/(frontend)/posts/[slug]/page.tsx +++ b/templates/with-vercel-website/src/app/(frontend)/posts/[slug]/page.tsx @@ -42,6 +42,7 @@ type Args = { } export default async function Post({ params: paramsPromise }: Args) { + const { isEnabled: draft } = await draftMode() const { slug = '' } = await paramsPromise const url = '/posts/' + slug const post = await queryPostBySlug({ slug }) @@ -55,7 +56,7 @@ export default async function Post({ params: paramsPromise }: Args) { {/* Allows redirects for valid pages too */} - + {draft && }