-
For example, I think it is possible if you have the following function. getDocTitle('docId(fileName)') |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
You might find these 2 hooks useful. import {useDocsVersion,useDocById} from '@docusaurus/theme-common';
useDocById("xyz").title
useDocsVersion().docs.find(doc => doc.title = "XYZ title").id But keep in mind they are for now internal APIs that we might do breaking changes on (altough it's unlikely the feature will totally disappear), so only use this wisely in your site code (ie avoid publishing an open-source plugin using those) Note: these hooks will only work on components rendered on docs page (ie not on your homepage or blog posts). One id can be used in multiple docs versions so you have to be browsing a specific version for Docusaurus to know which to return. |
Beta Was this translation helpful? Give feedback.
You might find these 2 hooks useful.
But keep in mind they are for now internal APIs that we might do breaking changes on (altough it's unlikely the feature will totally disappear), so only use this wisely in your site code (ie avoid publishing an open-source plugin using those)
Note: these hooks will only work on components rendered on docs page (ie not on your homepage or blog posts). One id can be used in multiple docs versions so you have to be browsing a specific version for Docusaurus to know which to return.