mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-03 19:32:35 +02:00
fix(v2): alpha 62 doc fixes (#3381)
* deprecated nextVersionLabel option * useActivePlugin failfast option * remove deprecated option nextVersionLabel * routeBasePath: '' should be forbidden * routeBasePath: '' should be forbidden * Docs: do not show version badge if there is only 1 version: https://github.com/facebook/docusaurus/issues/3362 * allow sidebars file to not exist: fallback to empty sidebars https://githu.com/facebook/docusaurus/issues/3366
This commit is contained in:
parent
2a3fe86579
commit
a4769e3f30
11 changed files with 80 additions and 35 deletions
|
@ -18,6 +18,7 @@ import {
|
|||
getActiveVersion,
|
||||
getActiveDocContext,
|
||||
getDocVersionSuggestions,
|
||||
GetActivePluginOptions,
|
||||
} from '../../client/docsClientUtils';
|
||||
|
||||
const useAllDocsData = (): Record<string, GlobalPluginData> =>
|
||||
|
@ -26,10 +27,10 @@ const useAllDocsData = (): Record<string, GlobalPluginData> =>
|
|||
const useDocsData = (pluginId: string | undefined) =>
|
||||
usePluginData('docusaurus-plugin-content-docs', pluginId) as GlobalPluginData;
|
||||
|
||||
export const useActivePlugin = () => {
|
||||
export const useActivePlugin = (options: GetActivePluginOptions = {}) => {
|
||||
const data = useAllDocsData();
|
||||
const {pathname} = useLocation();
|
||||
return getActivePlugin(data, pathname);
|
||||
return getActivePlugin(data, pathname, options);
|
||||
};
|
||||
|
||||
// versions are returned ordered (most recent first)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue