Closed kenjinakata closed 1 year ago
Fixed it by changing the preview route (Pls let me know if it's a better way):
import { draftMode } from "next/headers";
import { redirect } from "next/navigation";
export async function GET(request: Request) {
draftMode().enable();
const url = new URL(request.url);
const slug = (url.searchParams.get("slug") || "/")
if (slug === "/") {
return redirect("/");
} else {
redirect(`/${slug}`)
}
}
I'm in the process of working with the Iframe Pane plugin from the documentation. However, when I try to access the preview using the slug URL, I don't see the expected individual post page. Instead, it redirects me to the index page where all the posts are displayed. Do i have to update the preview route?