mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-13 17:17:28 +02:00
fix(content-docs): restore behavior when pagination front matter is null (#6124)
* fix(content-docs): restore behavior when pagination front matter is null * update snaps
This commit is contained in:
parent
8f18cbbeb3
commit
a5d2815154
5 changed files with 21 additions and 24 deletions
|
@ -319,12 +319,14 @@ export function addDocNavigation(
|
|||
return toDocNavigationLink(navDoc);
|
||||
};
|
||||
|
||||
const previous: DocNavLink | undefined = doc.frontMatter.pagination_prev
|
||||
? toNavigationLinkByDocId(doc.frontMatter.pagination_prev, 'prev')
|
||||
: toNavigationLink(navigation.previous, docsById);
|
||||
const next: DocNavLink | undefined = doc.frontMatter.pagination_next
|
||||
? toNavigationLinkByDocId(doc.frontMatter.pagination_next, 'next')
|
||||
: toNavigationLink(navigation.next, docsById);
|
||||
const previous =
|
||||
doc.frontMatter.pagination_prev !== undefined
|
||||
? toNavigationLinkByDocId(doc.frontMatter.pagination_prev, 'prev')
|
||||
: toNavigationLink(navigation.previous, docsById);
|
||||
const next =
|
||||
doc.frontMatter.pagination_next !== undefined
|
||||
? toNavigationLinkByDocId(doc.frontMatter.pagination_next, 'next')
|
||||
: toNavigationLink(navigation.next, docsById);
|
||||
|
||||
return {...doc, sidebar: navigation.sidebarName, previous, next};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue