Skip to content

Commit 26d2b9a

Browse files
slorberJosh-Cenawhiteandyzhe819datlechin
authored
chore: backport retro compatible commits for the Docusaurus v2.1 release (#8033)
Co-authored-by: sebastienlorber <lorber.sebastien@gmail.com> Co-authored-by: Joshua Chen <sidachen2003@gmail.com> Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com> Co-authored-by: whiteand <andrewbeletskiy@gmail.com> Co-authored-by: yzhe819 <68207314+yzhe819@users.noreply.github.com> Co-authored-by: Ngô Quốc Đạt <56961917+datlechin@users.noreply.github.com> Co-authored-by: Kevin Østerkilde <kevin@oesterkilde.dk> Co-authored-by: Bagdasar Ovsepyan <66012777+b-ovsepian@users.noreply.github.com> Co-authored-by: Yoni Chechik <chechik.yoni@gmail.com> Co-authored-by: adventure-yunfei <adventure.yunfei@gmail.com> Co-authored-by: Morgane Dubus <30866152+mdubus@users.noreply.github.com>
1 parent bb65b5c commit 26d2b9a

73 files changed

Lines changed: 757 additions & 243 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/create-docusaurus/templates/facebook/sidebars.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,12 @@ module.exports = {
2525
// But you can create a sidebar manually
2626
/*
2727
tutorialSidebar: [
28+
'intro',
29+
'hello',
2830
{
2931
type: 'category',
3032
label: 'Tutorial',
31-
items: ['hello'],
33+
items: ['tutorial-basics/create-a-document'],
3234
},
3335
],
3436
*/

packages/create-docusaurus/templates/shared/docs/tutorial-basics/congratulations.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ Anything **unclear** or **buggy** in this tutorial? [Please report it!](https://
1414

1515
## What's next?
1616

17-
- Read the [official documentation](https://docusaurus.io/).
17+
- Read the [official documentation](https://docusaurus.io/)
18+
- Modify your site configuration with [`docusaurus.config.js`](https://docusaurus.io/docs/api/docusaurus-config)
19+
- Add navbar and footer items with [`themeConfig`](https://docusaurus.io/docs/api/themes/configuration)
1820
- Add a custom [Design and Layout](https://docusaurus.io/docs/styling-layout)
1921
- Add a [search bar](https://docusaurus.io/docs/search)
2022
- Find inspirations in the [Docusaurus showcase](https://docusaurus.io/showcase)

packages/create-docusaurus/templates/shared/docs/tutorial-basics/create-a-document.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,13 @@ It is also possible to create your sidebar explicitly in `sidebars.js`:
4444
```js title="sidebars.js"
4545
module.exports = {
4646
tutorialSidebar: [
47+
'intro',
48+
// highlight-next-line
49+
'hello',
4750
{
4851
type: 'category',
4952
label: 'Tutorial',
50-
// highlight-next-line
51-
items: ['hello'],
53+
items: ['tutorial-basics/create-a-document'],
5254
},
5355
],
5456
};

packages/create-docusaurus/templates/shared/sidebars.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@ const sidebars = {
1919
// But you can create a sidebar manually
2020
/*
2121
tutorialSidebar: [
22+
'intro',
23+
'hello',
2224
{
2325
type: 'category',
2426
label: 'Tutorial',
25-
items: ['hello'],
27+
items: ['tutorial-basics/create-a-document'],
2628
},
2729
],
2830
*/

packages/docusaurus-plugin-content-blog/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
"webpack": "^5.73.0"
3737
},
3838
"devDependencies": {
39-
"@docusaurus/types": "2.0.0-beta.21",
4039
"escape-string-regexp": "^4.0.0"
4140
},
4241
"peerDependencies": {

packages/docusaurus-plugin-content-docs/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
"webpack": "^5.73.0"
5353
},
5454
"devDependencies": {
55-
"@docusaurus/types": "2.0.0-beta.21",
5655
"@types/js-yaml": "^4.0.5",
5756
"@types/picomatch": "^2.3.0",
5857
"commander": "^5.1.0",

packages/docusaurus-plugin-content-docs/src/__tests__/__snapshots__/index.test.ts.snap

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -901,6 +901,7 @@ exports[`simple website content: data 1`] = `
901901
"label": "Next",
902902
"banner": null,
903903
"badge": false,
904+
"noIndex": false,
904905
"className": "docs-version-current",
905906
"isLast": true,
906907
"docsSidebars": {
@@ -2608,6 +2609,7 @@ exports[`versioned website (community) content: data 1`] = `
26082609
"label": "1.0.0",
26092610
"banner": null,
26102611
"badge": true,
2612+
"noIndex": false,
26112613
"className": "docs-version-1.0.0",
26122614
"isLast": true,
26132615
"docsSidebars": {
@@ -2635,6 +2637,7 @@ exports[`versioned website (community) content: data 1`] = `
26352637
"label": "Next",
26362638
"banner": "unreleased",
26372639
"badge": true,
2640+
"noIndex": false,
26382641
"className": "docs-version-current",
26392642
"isLast": false,
26402643
"docsSidebars": {
@@ -3477,6 +3480,7 @@ exports[`versioned website content: data 1`] = `
34773480
"label": "1.0.0",
34783481
"banner": "unmaintained",
34793482
"badge": true,
3483+
"noIndex": false,
34803484
"className": "docs-version-1.0.0",
34813485
"isLast": false,
34823486
"docsSidebars": {
@@ -3544,6 +3548,7 @@ exports[`versioned website content: data 1`] = `
35443548
"label": "1.0.1",
35453549
"banner": null,
35463550
"badge": true,
3551+
"noIndex": true,
35473552
"className": "docs-version-1.0.1",
35483553
"isLast": true,
35493554
"docsSidebars": {
@@ -3599,6 +3604,7 @@ exports[`versioned website content: data 1`] = `
35993604
"label": "Next",
36003605
"banner": "unreleased",
36013606
"badge": true,
3607+
"noIndex": false,
36023608
"className": "docs-version-current",
36033609
"isLast": false,
36043610
"docsSidebars": {
@@ -3674,6 +3680,7 @@ exports[`versioned website content: data 1`] = `
36743680
"label": "withSlugs",
36753681
"banner": "unmaintained",
36763682
"badge": true,
3683+
"noIndex": false,
36773684
"className": "docs-version-withSlugs",
36783685
"isLast": false,
36793686
"docsSidebars": {

packages/docusaurus-plugin-content-docs/src/__tests__/index.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,11 @@ describe('versioned website', () => {
362362
options: {
363363
routeBasePath,
364364
sidebarPath,
365+
versions: {
366+
'1.0.1': {
367+
noIndex: true,
368+
},
369+
},
365370
},
366371
});
367372
const plugin = await pluginContentDocs(context, options);

packages/docusaurus-plugin-content-docs/src/__tests__/options.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ describe('normalizeDocsPluginOptions', () => {
7676
version1: {
7777
path: 'hello',
7878
label: 'world',
79+
noIndex: true,
7980
},
8081
},
8182
sidebarCollapsible: false,

packages/docusaurus-plugin-content-docs/src/options.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ const VersionOptionsSchema = Joi.object({
5959
banner: Joi.string().equal('none', 'unreleased', 'unmaintained').optional(),
6060
badge: Joi.boolean().optional(),
6161
className: Joi.string().optional(),
62+
noIndex: Joi.boolean().optional(),
6263
});
6364

6465
const VersionsOptionsSchema = Joi.object()

0 commit comments

Comments
 (0)