Skip to content

Is there a way to configure pages to display custom components that have access to frontmatter? #1508

Answered by fuma-nama
williamlmao asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, if you are using nextra-docs-theme, here's how you can get the frontMatter of the page

import { useConfig } from "nextra-theme-docs";

//inside a component
const frontMatter = useConfig().frontMatter

To inject components into the body, you may override the main component
Check here for further information

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@williamlmao
Comment options

Answer selected by williamlmao
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants