mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-15 17:22:35 +02:00
fix(v2): sidebar_label should be used to compute next/previous button labels (#4970)
* sidebar_label should be used to compute next/previous button texts, as documented. * improve docs frontmatter doc * use a little bit of destructuring
This commit is contained in:
parent
aeb8e9da51
commit
737f80a026
8 changed files with 75 additions and 38 deletions
|
@ -198,10 +198,13 @@ export default function pluginContentDocs(
|
|||
previousId,
|
||||
nextId,
|
||||
} = sidebarsUtils.getDocNavigation(doc.id);
|
||||
const toDocNavLink = (navDocId: string): DocNavLink => ({
|
||||
title: docsBaseById[navDocId].title,
|
||||
permalink: docsBaseById[navDocId].permalink,
|
||||
});
|
||||
const toDocNavLink = (navDocId: string): DocNavLink => {
|
||||
const {title, permalink, frontMatter} = docsBaseById[navDocId];
|
||||
return {
|
||||
title: frontMatter.sidebar_label ?? title,
|
||||
permalink,
|
||||
};
|
||||
};
|
||||
return {
|
||||
...doc,
|
||||
sidebar: sidebarName,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue