-
Notifications
You must be signed in to change notification settings - Fork 26.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
examples: Updating WordPress example to Next 14 #62447
base: canary
Are you sure you want to change the base?
examples: Updating WordPress example to Next 14 #62447
Conversation
d3d7e58
to
80d7e6a
Compare
Thanks for this suggestion!
|
@Bjornnyborg Thank you for submitting a PR! If you can you address the comments, above, we will be able to progress with this. |
…ic type generation, redirect handling, robots.txt, sitemap.xml and seamless preview/draft preview functionality
80d7e6a
to
5d65b98
Compare
Allow CI Workflow Run
Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer |
1 similar comment
Allow CI Workflow Run
Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer |
New dependencies detected. Learn more about Socket for GitHub ↗︎
|
Hey @leerob and @samcx ! Thanks for getting back on this PR. 😊 I have updated the PR now:
Anything else i should improve? 😊 |
@Bjornnyborg Not sure if it was intentional, but it seems the navigation is waiting to load data—could there be a better way to implement this? |
@samcx Good catch! Added the |
Updating the WordPress example, to a more modern example.
Key features:
robots.ts
: This automatically gets the robots.txt of the API route and serves it on the/robots.txt
route.sitemap.ts
: This automatically gets all paths from the API and generates a sitemap to serve on the/sitemap.xml
route.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", your 404 page will then be editable from your CMS.codegen.ts
: Automatic type generation for your WordPress installationDraft Mode
: Seamless Preview / Draft Preview support, using authentication through WPGraphQL JWT Authentication and Next.js Draft ModeOn Demand Cache Revalidation
: Including a bare minimum WordPress theme that implements cache revalidation, WordPress link rewrites and other utils for integrating with Next.js✅ The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
✅ Make sure the linting passes by running pnpm build && pnpm lint. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md