Description
An Incremental Static Regeneration Blog Example Using Next.js and WordPress
npx boilerapp isr-blog-nextjs-wordpress文档
A Feature Rich App Router WordPress Example
This is an example on how you can build a Next.js 14 project (with App Router), using WordPress as the data source.
Key features:
robots.ts: This automatically gets the robots.txt of the API route and serves it on the/robots.txtroute.sitemap.ts: This automatically gets all paths from the API and generates a sitemap to serve on the/sitemap.xmlroute.middleware.ts: This contains a middleware function that checks the users path for stored redirects, and redirects the user if a match is found.[[...slug]]: This is the catch-all route that is used to render all pages. It is important that this route is not removed, as it is used to render all pages. It fetches the ContentType and renders the correspondingnot-found.tsx: This page is used for dynamic 404 handling - adjust the database id to match your decired WordPress page, and make sure the WordPress slug is "not-found\
Prix
Gratuit