Skip to content
Discussion options

You must be logged in to vote

It looks similar to what @lanegoolsby is trying to do, see my answer here: #7644 (comment)

shall I eject the TOC (which is not safe) or is there another safer alternative?

It depends

The first question to ask yourself is: do you want to customize all Docusaurus TOCs (desktop? mobile?) at once, or just a specific case (desktop only? docs only?)

can I read frontmatter info during build time to populate the content?

I'm not sure what you mean by that 🤷‍♂️ But:

  • For docs, you can use useDoc().frontMatter.displayMetadata
  • For blog posts, you can use useBlogPost().frontMatter.displayMetadata

Don't be too afraid by "internal", "unsafe" etc, those are too scary but what we mean in the end is…

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@LunaticMuch
Comment options

@slorber
Comment options

slorber Aug 9, 2022
Collaborator

Answer selected by LunaticMuch
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants