Closed mkrtchian closed 1 year ago
There is a link to explain the usage of
useConfig
in this section of docs theme documentation. It is pointing tohttps://nextra.site/docs/docs-theme/api/use-config
I tried to search for it in case the page has been moved, but didn't find it.
@mkrtchian The Nextra team works day and night to provide Nextra.
A lot of documentation is still missing, but it will soon be provided
My goal was just to help by reporting the broken link. No problem if it gets fixed much later.
My goal was just to help by reporting the broken link. No problem if it gets fixed much later.
@mkrtchian i didn't mean it in a bad way, but maybe if we ask for help to better understand the nextra api, we could write the docs and ask the team to merge the PR
Sure, I understand what you mean. I don't have enough time now, but I will also try to contribute with PRs later.
Yeah there're many things missing in the docs, but the good thing is you can understand these APIs better through types. We are also happy to accept PRs for docs improvements!
For anyone else looking for more info on this:
This file has all the code for the useConfig
react hook: https://github.com/shuding/nextra/blob/73241b3fee58f0318e9349a5eb7650a7cd55a4e3/packages/nextra-theme-docs/src/contexts/config.tsx#L27
You can use it by calling the hook in your react component before rendering, like this:
import { useConfig } from 'nextra-theme-docs'
const MyComponent = () => {
const config = useConfig()
return <p>{config.title}</p>
}
It has all of these properties:
0 "banner" 1 "chat" 2 "darkMode" 3 "direction" 4 "docsRepositoryBase" 5 "editLink" 6 "feedback" 7 "footer" 8 "gitTimestamp" 9 "head" 10 "i18n" 11 "logo" 12 "logoLink" 13 "navbar" 14 "navigation" 15 "nextThemes" 16 "notFound" 17 "primaryHue" 18 "project" 19 "search" 20 "serverSideError" 21 "sidebar" 22 "toc" 23 "useNextSeoProps" 24 "components" 25 "main" 26 "flexsearch" 27 "title" 28 "frontMatter"
I think I can work on the docs for useConfig. It will just take longer time since i have other work
There is a link to explain the usage of
useConfig
in this section of docs theme documentation. It is pointing tohttps://nextra.site/docs/docs-theme/api/use-config
I tried to search for it in case the page has been moved, but didn't find it.