Skip to content

Commit

Permalink
feat: add yoast seo compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukas Neugebauer committed Feb 24, 2025
1 parent fcc43a4 commit 11b844c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/server/utils/dataLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down
8 changes: 8 additions & 0 deletions src/utils/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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*',
Expand Down

0 comments on commit 11b844c

Please sign in to comment.