From aaa798a224437f7eb02336d065f52c1591ed28aa Mon Sep 17 00:00:00 2001 From: Lukas Neugebauer <25110308+lneugebauer@users.noreply.github.com> Date: Mon, 24 Feb 2025 17:26:24 +0100 Subject: [PATCH] feat: add yoast seo compatibility --- src/server/utils/dataLoader.ts | 2 +- src/utils/config.ts | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/server/utils/dataLoader.ts b/src/server/utils/dataLoader.ts index f188c6c..383298d 100644 --- a/src/server/utils/dataLoader.ts +++ b/src/server/utils/dataLoader.ts @@ -73,7 +73,7 @@ export const loadPreviewDocumentProps = async ( throw new Error('Missing NEOS_BASE_URL environment variable'); } - const contextPath = searchParams['node[__contextNodePath]']; + const contextPath = searchParams['node[__contextNodePath]'] ?? searchParams['node']; if (typeof contextPath !== 'string') { throw new Error('Missing context path query parameter'); } diff --git a/src/utils/config.ts b/src/utils/config.ts index b88b915..fa2a9e1 100644 --- a/src/utils/config.ts +++ b/src/utils/config.ts @@ -6,6 +6,14 @@ export const withZebra = (nextConfig: NextConfig): NextConfig => { rewrites: async () => { const baseUrl = process.env.NEOS_BASE_URL ?? ''; const neosRewrites = [ + { + source: '/neosyoastseo/data/:path*', + destination: baseUrl + '/neosyoastseo/data/:path*', + }, + { + source: '/neosyoastseo/page/renderPreviewPage', + destination: '/neos/preview', + }, { source: '/neos/:path*', destination: baseUrl + '/neos/:path*',