Is it possible to use markdoc with Nextjs 13 Pages and Layout inside the appDir? #329
-
Are there any references for using markdoc with the Nextjs 13 App Directory feature? Trying to referencing the "Using Markdoc with Next.js" example from the docs (https://markdoc.dev/docs/nextjs), but am unsure how to set up the files for a Layout (https://beta.nextjs.org/docs/routing/pages-and-layouts#layouts) in the App Directory to wrap around the pages generated by markdoc. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
@ZYJLiu not at the moment, but we would love help from the community for coming up with a Next.js 13 example. I don't imagine there would be any constraints (just put your Markdoc pages in Please let me know if you try to integrate with |
Beta Was this translation helpful? Give feedback.
-
Hi @mfix-stripe I recently started a project and used the experimental app with app folder structure. Wanted to use Markdoc but read and figured out that the plugin was not yet supported. I still wanted to use the app dir for my pages and layout etc so figured out a solution to get it working for my project. I created an starter example project with the solution that I used. It's not yet the most beautiful solution but works perfectly for me. I tried to use all the provided next features to optimize it like: generateStaticParams, generateMetadata and the new data fetching methods. See the repository here: https://github.com/dylanmeivis/nextjs13-starter-markdoc#readme |
Beta Was this translation helpful? Give feedback.
-
Support for app router has been added on |
Beta Was this translation helpful? Give feedback.
@ZYJLiu not at the moment, but we would love help from the community for coming up with a Next.js 13 example.
I don't imagine there would be any constraints (just put your Markdoc pages in
app/
instead ofpages/
), but there might be some unforeseen things about Next.js 13 that don't work with our dependencies (e.g. we rely on Next.js's Webpack config to parse and bundle the Markdoc documents). I am not sure yet.Please let me know if you try to integrate with
next@13
and see what issues you run in to.