mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-30 23:08:54 +02:00
feat(content-docs): sidebar category linking to document or auto-generated index page (#5830)
Co-authored-by: Joshua Chen <sidachen2003@gmail.com> Co-authored-by: Armano <armano2@users.noreply.github.com> Co-authored-by: Alexey Pyltsyn <lex61rus@gmail.com>
This commit is contained in:
parent
95f911efef
commit
cfae5d0933
105 changed files with 3904 additions and 816 deletions
|
@ -619,6 +619,32 @@ describe('versioned website', () => {
|
|||
{label: 'barTag 3', permalink: '/docs/next/tags/barTag-3-permalink'},
|
||||
],
|
||||
});
|
||||
expect(getDocById(version101, 'foo/bar')).toEqual({
|
||||
...defaultDocMetadata,
|
||||
id: 'version-1.0.1/foo/bar',
|
||||
unversionedId: 'foo/bar',
|
||||
sourceDirName: 'foo',
|
||||
isDocsHomePage: false,
|
||||
permalink: '/docs/foo/bar',
|
||||
slug: '/foo/bar',
|
||||
source: path.posix.join(
|
||||
'@site',
|
||||
posixPath(path.relative(siteDir, version101.contentPath)),
|
||||
'foo',
|
||||
'bar.md',
|
||||
),
|
||||
title: 'bar',
|
||||
description: 'Bar 1.0.1 !',
|
||||
frontMatter: {},
|
||||
version: '1.0.1',
|
||||
sidebar: 'VersionedSideBarNameDoesNotMatter/docs',
|
||||
next: {
|
||||
title: 'hello',
|
||||
permalink: '/docs/',
|
||||
},
|
||||
tags: [],
|
||||
});
|
||||
|
||||
expect(getDocById(currentVersion, 'hello')).toEqual({
|
||||
...defaultDocMetadata,
|
||||
id: 'hello',
|
||||
|
@ -659,7 +685,7 @@ describe('versioned website', () => {
|
|||
description: 'Hello 1.0.1 !',
|
||||
frontMatter: {},
|
||||
version: '1.0.1',
|
||||
sidebar: 'version-1.0.1/docs',
|
||||
sidebar: 'VersionedSideBarNameDoesNotMatter/docs',
|
||||
previous: {
|
||||
title: 'bar',
|
||||
permalink: '/docs/foo/bar',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue