mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-15 01:02:35 +02:00
fix: highlight appropriate navItem based on active sidebar item (#6310)
* fix: highlight appropriate navItem based on active sidebar item * fix: try using location.pathname * fix: remote console.log * fix: include category generated indices in globalData * Add test * fix snap Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
This commit is contained in:
parent
6e75d035bb
commit
3e5944ef1f
5 changed files with 73 additions and 9 deletions
|
@ -20,10 +20,12 @@ export async function createCategoryGeneratedIndexRoutes({
|
|||
version,
|
||||
actions,
|
||||
docCategoryGeneratedIndexComponent,
|
||||
aliasedSource,
|
||||
}: {
|
||||
version: LoadedVersion;
|
||||
actions: PluginContentLoadedActions;
|
||||
docCategoryGeneratedIndexComponent: string;
|
||||
aliasedSource: (str: string) => string;
|
||||
}): Promise<RouteConfig[]> {
|
||||
const slugs = createSlugger();
|
||||
|
||||
|
@ -69,7 +71,7 @@ export async function createCategoryGeneratedIndexRoutes({
|
|||
component: docCategoryGeneratedIndexComponent,
|
||||
exact: true,
|
||||
modules: {
|
||||
categoryGeneratedIndex: propData,
|
||||
categoryGeneratedIndex: aliasedSource(propData),
|
||||
},
|
||||
// Same as doc, this sidebar route attribute permits to associate this subpage to the given sidebar
|
||||
...(sidebar && {sidebar}),
|
||||
|
@ -149,6 +151,7 @@ export async function createVersionRoutes({
|
|||
version,
|
||||
actions,
|
||||
docCategoryGeneratedIndexComponent,
|
||||
aliasedSource,
|
||||
}),
|
||||
]);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue