-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add support for Next.js app router exports #34
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bradlc I'd like to group all the Next.js specific items under a single key, as you suggested above. I was thinking the key could be called next.js
or nextjs
, just to disambiguate with the work "next".
What do you think?
metadata
export
Makes sense! I've updated the PR to include all exports that I could find under a Export names come from:
Let me know if you have any additional feedback! 🤙 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @bradlc! Just a couple comments
src/loader.js
Outdated
] | ||
const nextjsExportsCode = nextjsExports | ||
.map((name) => { | ||
return `export const ${name} = frontmatter.nextjs?.${name};` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rpaul-stripe WDYT about using the nextjs
frontmatter key to allow users to specify Next.js specific features (like metadata
and revalidate
)
Alternative keys:
next.js
config
/options
(higher chance for collisions)
I think I like next.js
best (personally)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think nextjs
is good.
Co-authored-by: Mike Fix <62121649+mfix-stripe@users.noreply.github.com>
Co-authored-by: Mike Fix <62121649+mfix-stripe@users.noreply.github.com>
'revalidate', | ||
] | ||
const nextjsExportsCode = nextjsExports | ||
.map((name) => `export const ${name} = frontmatter.nextjs?.${name};`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rpaul-stripe WDYT about using the nextjs
frontmatter key to allow users to specify Next.js specific features (like metadata
and revalidate
)
Alternative keys:
next.js
config
/options
(higher chance for collisions)
I think I like next.js
best (personally)
Ref: markdoc/markdoc#416, markdoc/markdoc#418
This PR adds support for specifying the
metadata
andrevalidate
exports when using app router:Closes markdoc/markdoc#418
Closes markdoc/markdoc#416