Skip to content

Commit

Permalink
fix: can't use force-static with draft mode
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasio committed Jul 9, 2024
1 parent 2dc5a06 commit f86a8cb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/next/src/rsc/handlers/previewRouteHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ export async function previewRouteHandler(
}

const { config } = getHostAndConfigFromRequest(request);

const { sourceUrl, preview } = config;

const revision = is_revision === '1';
Expand Down
7 changes: 5 additions & 2 deletions projects/wp-nextjs-app/src/app/(single)/[...path]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import { BlocksRenderer, HtmlDecoder } from '@headstartwp/core/react';
import { HeadstartWPRoute, queryPost } from '@headstartwp/next/app';

export const dynamic = 'force-static';

const Single = async ({ params }: HeadstartWPRoute) => {
const { data } = await queryPost({
routeParams: params,
options: {
headers: {
cache: 'force-cache',
},
},
});

return (
Expand Down

0 comments on commit f86a8cb

Please sign in to comment.