diff --git a/packages/docusaurus-plugin-content-docs/src/__tests__/__snapshots__/index.test.ts.snap b/packages/docusaurus-plugin-content-docs/src/__tests__/__snapshots__/index.test.ts.snap index 07bbba5e2381f..43c8b71f292d4 100644 --- a/packages/docusaurus-plugin-content-docs/src/__tests__/__snapshots__/index.test.ts.snap +++ b/packages/docusaurus-plugin-content-docs/src/__tests__/__snapshots__/index.test.ts.snap @@ -61,7 +61,6 @@ exports[`simple website content 1`] = ` }, "id": "foo/baz", "isDraft": false, - "isUnlisted": false, "lastUpdatedAt": undefined, "lastUpdatedBy": undefined, "next": { @@ -111,7 +110,6 @@ exports[`simple website content 2`] = ` }, "id": "hello", "isDraft": false, - "isUnlisted": false, "lastUpdatedAt": undefined, "lastUpdatedBy": undefined, "next": undefined, @@ -155,7 +153,6 @@ exports[`simple website content 3`] = ` }, "id": "foo/bar", "isDraft": false, - "isUnlisted": false, "lastUpdatedAt": undefined, "lastUpdatedBy": undefined, "next": undefined, @@ -405,8 +402,7 @@ exports[`simple website content: data 1`] = ` \\"tags\\": [], \\"version\\": \\"current\\", \\"frontMatter\\": {}, - \\"isDraft\\": false, - \\"isUnlisted\\": false + \\"isDraft\\": false }", "site-docs-draft-md-5b1.json": "{ \\"unversionedId\\": \\"draft\\", @@ -422,8 +418,7 @@ exports[`simple website content: data 1`] = ` \\"frontMatter\\": { \\"draft\\": true }, - \\"isDraft\\": false, - \\"isUnlisted\\": false + \\"isDraft\\": false }", "site-docs-foo-bar-md-8c2.json": "{ \\"unversionedId\\": \\"foo/bar\\", @@ -444,7 +439,6 @@ exports[`simple website content: data 1`] = ` \\"pagination_prev\\": null }, \\"isDraft\\": false, - \\"isUnlisted\\": false, \\"sidebar\\": \\"docs\\" }", "site-docs-foo-baz-md-a69.json": "{ @@ -482,7 +476,6 @@ exports[`simple website content: data 1`] = ` ] }, \\"isDraft\\": false, - \\"isUnlisted\\": false, \\"sidebar\\": \\"docs\\", \\"previous\\": { \\"title\\": \\"Bar\\", @@ -506,7 +499,6 @@ exports[`simple website content: data 1`] = ` \\"version\\": \\"current\\", \\"frontMatter\\": {}, \\"isDraft\\": false, - \\"isUnlisted\\": false, \\"sidebar\\": \\"docs\\", \\"previous\\": { \\"title\\": \\"rootTryToEscapeSlug\\", @@ -548,7 +540,6 @@ exports[`simple website content: data 1`] = ` \\"slug\\": \\"/\\" }, \\"isDraft\\": false, - \\"isUnlisted\\": false, \\"sidebar\\": \\"docs\\", \\"previous\\": { \\"title\\": \\"My heading as title\\", @@ -570,8 +561,7 @@ exports[`simple website content: data 1`] = ` \\"frontMatter\\": { \\"custom_edit_url\\": null }, - \\"isDraft\\": false, - \\"isUnlisted\\": false + \\"isDraft\\": false }", "site-docs-lorem-md-b27.json": "{ \\"unversionedId\\": \\"lorem\\", @@ -589,8 +579,7 @@ exports[`simple website content: data 1`] = ` \\"custom_edit_url\\": \\"https://github.com/customUrl/docs/lorem.md\\", \\"unrelated_front_matter\\": \\"won't be part of metadata\\" }, - \\"isDraft\\": false, - \\"isUnlisted\\": false + \\"isDraft\\": false }", "site-docs-root-absolute-slug-md-db5.json": "{ \\"unversionedId\\": \\"rootAbsoluteSlug\\", @@ -609,7 +598,6 @@ exports[`simple website content: data 1`] = ` \\"pagination_prev\\": \\"foo/baz\\" }, \\"isDraft\\": false, - \\"isUnlisted\\": false, \\"sidebar\\": \\"docs\\", \\"previous\\": { \\"title\\": \\"baz pagination_label\\", @@ -637,7 +625,6 @@ exports[`simple website content: data 1`] = ` \\"pagination_prev\\": \\"foo/baz\\" }, \\"isDraft\\": false, - \\"isUnlisted\\": false, \\"sidebar\\": \\"docs\\", \\"previous\\": { \\"title\\": \\"baz pagination_label\\", @@ -665,7 +652,6 @@ exports[`simple website content: data 1`] = ` \\"pagination_prev\\": \\"foo/baz\\" }, \\"isDraft\\": false, - \\"isUnlisted\\": false, \\"sidebar\\": \\"docs\\", \\"previous\\": { \\"title\\": \\"baz pagination_label\\", @@ -693,7 +679,6 @@ exports[`simple website content: data 1`] = ` \\"pagination_prev\\": \\"foo/baz\\" }, \\"isDraft\\": false, - \\"isUnlisted\\": false, \\"sidebar\\": \\"docs\\", \\"previous\\": { \\"title\\": \\"baz pagination_label\\", @@ -718,8 +703,7 @@ exports[`simple website content: data 1`] = ` \\"frontMatter\\": { \\"slug\\": \\"/absoluteSlug\\" }, - \\"isDraft\\": false, - \\"isUnlisted\\": false + \\"isDraft\\": false }", "site-docs-slugs-relative-slug-md-d1c.json": "{ \\"unversionedId\\": \\"slugs/relativeSlug\\", @@ -735,8 +719,7 @@ exports[`simple website content: data 1`] = ` \\"frontMatter\\": { \\"slug\\": \\"relativeSlug\\" }, - \\"isDraft\\": false, - \\"isUnlisted\\": false + \\"isDraft\\": false }", "site-docs-slugs-resolved-slug-md-02b.json": "{ \\"unversionedId\\": \\"slugs/resolvedSlug\\", @@ -752,8 +735,7 @@ exports[`simple website content: data 1`] = ` \\"frontMatter\\": { \\"slug\\": \\"./hey/ho/../resolvedSlug\\" }, - \\"isDraft\\": false, - \\"isUnlisted\\": false + \\"isDraft\\": false }", "site-docs-slugs-try-to-escape-slug-md-70d.json": "{ \\"unversionedId\\": \\"slugs/tryToEscapeSlug\\", @@ -769,8 +751,7 @@ exports[`simple website content: data 1`] = ` \\"frontMatter\\": { \\"slug\\": \\"../../../../../../../../tryToEscapeSlug\\" }, - \\"isDraft\\": false, - \\"isUnlisted\\": false + \\"isDraft\\": false }", "tag-docs-tags-tag-1-b3f.json": "{ \\"name\\": \\"tag 1\\", @@ -1482,7 +1463,6 @@ exports[`site with custom sidebar items generator sidebarItemsGenerator is calle "frontMatter": {}, "id": "API/Core APIs/Client API", "isDraft": false, - "isUnlisted": false, "sidebarPosition": 0, "source": "@site/docs/3-API/01_Core APIs/0 --- Client API.md", "sourceDirName": "3-API/01_Core APIs", @@ -1492,7 +1472,6 @@ exports[`site with custom sidebar items generator sidebarItemsGenerator is calle "frontMatter": {}, "id": "API/Core APIs/Server API", "isDraft": false, - "isUnlisted": false, "sidebarPosition": 1, "source": "@site/docs/3-API/01_Core APIs/1 --- Server API.md", "sourceDirName": "3-API/01_Core APIs", @@ -1502,7 +1481,6 @@ exports[`site with custom sidebar items generator sidebarItemsGenerator is calle "frontMatter": {}, "id": "API/Extension APIs/Plugin API", "isDraft": false, - "isUnlisted": false, "sidebarPosition": 0, "source": "@site/docs/3-API/02_Extension APIs/0. Plugin API.md", "sourceDirName": "3-API/02_Extension APIs", @@ -1512,7 +1490,6 @@ exports[`site with custom sidebar items generator sidebarItemsGenerator is calle "frontMatter": {}, "id": "API/Extension APIs/Theme API", "isDraft": false, - "isUnlisted": false, "sidebarPosition": 1, "source": "@site/docs/3-API/02_Extension APIs/1. Theme API.md", "sourceDirName": "3-API/02_Extension APIs", @@ -1522,7 +1499,6 @@ exports[`site with custom sidebar items generator sidebarItemsGenerator is calle "frontMatter": {}, "id": "API/api-end", "isDraft": false, - "isUnlisted": false, "sidebarPosition": 3, "source": "@site/docs/3-API/03_api-end.md", "sourceDirName": "3-API", @@ -1532,7 +1508,6 @@ exports[`site with custom sidebar items generator sidebarItemsGenerator is calle "frontMatter": {}, "id": "API/api-overview", "isDraft": false, - "isUnlisted": false, "sidebarPosition": 0, "source": "@site/docs/3-API/00_api-overview.md", "sourceDirName": "3-API", @@ -1545,7 +1520,6 @@ exports[`site with custom sidebar items generator sidebarItemsGenerator is calle }, "id": "Guides/guide1", "isDraft": false, - "isUnlisted": false, "sidebarPosition": 1, "source": "@site/docs/Guides/z-guide1.md", "sourceDirName": "Guides", @@ -1557,7 +1531,6 @@ exports[`site with custom sidebar items generator sidebarItemsGenerator is calle }, "id": "Guides/guide2", "isDraft": false, - "isUnlisted": false, "sidebarPosition": 2, "source": "@site/docs/Guides/02-guide2.md", "sourceDirName": "Guides", @@ -1570,7 +1543,6 @@ exports[`site with custom sidebar items generator sidebarItemsGenerator is calle }, "id": "Guides/guide2.5", "isDraft": false, - "isUnlisted": false, "sidebarPosition": 2.5, "source": "@site/docs/Guides/0-guide2.5.md", "sourceDirName": "Guides", @@ -1583,7 +1555,6 @@ exports[`site with custom sidebar items generator sidebarItemsGenerator is calle }, "id": "Guides/guide3", "isDraft": false, - "isUnlisted": false, "sidebarPosition": 3, "source": "@site/docs/Guides/guide3.md", "sourceDirName": "Guides", @@ -1595,7 +1566,6 @@ exports[`site with custom sidebar items generator sidebarItemsGenerator is calle }, "id": "Guides/guide4", "isDraft": false, - "isUnlisted": false, "sidebarPosition": undefined, "source": "@site/docs/Guides/a-guide4.md", "sourceDirName": "Guides", @@ -1607,7 +1577,6 @@ exports[`site with custom sidebar items generator sidebarItemsGenerator is calle }, "id": "Guides/guide5", "isDraft": false, - "isUnlisted": false, "sidebarPosition": undefined, "source": "@site/docs/Guides/b-guide5.md", "sourceDirName": "Guides", @@ -1617,7 +1586,6 @@ exports[`site with custom sidebar items generator sidebarItemsGenerator is calle "frontMatter": {}, "id": "getting-started", "isDraft": false, - "isUnlisted": false, "sidebarPosition": 0, "source": "@site/docs/0-getting-started.md", "sourceDirName": ".", @@ -1627,7 +1595,6 @@ exports[`site with custom sidebar items generator sidebarItemsGenerator is calle "frontMatter": {}, "id": "installation", "isDraft": false, - "isUnlisted": false, "sidebarPosition": 1, "source": "@site/docs/1-installation.md", "sourceDirName": ".", @@ -1659,7 +1626,6 @@ exports[`site with full autogenerated sidebar docs in fully generated sidebar ha "frontMatter": {}, "id": "getting-started", "isDraft": false, - "isUnlisted": false, "lastUpdatedAt": undefined, "lastUpdatedBy": undefined, "next": { @@ -1688,7 +1654,6 @@ exports[`site with full autogenerated sidebar docs in fully generated sidebar ha "frontMatter": {}, "id": "installation", "isDraft": false, - "isUnlisted": false, "lastUpdatedAt": undefined, "lastUpdatedBy": undefined, "next": { @@ -1723,7 +1688,6 @@ exports[`site with full autogenerated sidebar docs in fully generated sidebar ha }, "id": "Guides/guide1", "isDraft": false, - "isUnlisted": false, "lastUpdatedAt": undefined, "lastUpdatedBy": undefined, "next": { @@ -1757,7 +1721,6 @@ exports[`site with full autogenerated sidebar docs in fully generated sidebar ha }, "id": "Guides/guide2", "isDraft": false, - "isUnlisted": false, "lastUpdatedAt": undefined, "lastUpdatedBy": undefined, "next": { @@ -1792,7 +1755,6 @@ exports[`site with full autogenerated sidebar docs in fully generated sidebar ha }, "id": "Guides/guide2.5", "isDraft": false, - "isUnlisted": false, "lastUpdatedAt": undefined, "lastUpdatedBy": undefined, "next": { @@ -1827,7 +1789,6 @@ exports[`site with full autogenerated sidebar docs in fully generated sidebar ha }, "id": "Guides/guide3", "isDraft": false, - "isUnlisted": false, "lastUpdatedAt": undefined, "lastUpdatedBy": undefined, "next": { @@ -1861,7 +1822,6 @@ exports[`site with full autogenerated sidebar docs in fully generated sidebar ha }, "id": "Guides/guide4", "isDraft": false, - "isUnlisted": false, "lastUpdatedAt": undefined, "lastUpdatedBy": undefined, "next": { @@ -1895,7 +1855,6 @@ exports[`site with full autogenerated sidebar docs in fully generated sidebar ha }, "id": "Guides/guide5", "isDraft": false, - "isUnlisted": false, "lastUpdatedAt": undefined, "lastUpdatedBy": undefined, "next": { @@ -1927,7 +1886,6 @@ exports[`site with full autogenerated sidebar docs in fully generated sidebar ha "frontMatter": {}, "id": "API/api-overview", "isDraft": false, - "isUnlisted": false, "lastUpdatedAt": undefined, "lastUpdatedBy": undefined, "next": { @@ -1959,7 +1917,6 @@ exports[`site with full autogenerated sidebar docs in fully generated sidebar ha "frontMatter": {}, "id": "API/Core APIs/Client API", "isDraft": false, - "isUnlisted": false, "lastUpdatedAt": undefined, "lastUpdatedBy": undefined, "next": { @@ -1991,7 +1948,6 @@ exports[`site with full autogenerated sidebar docs in fully generated sidebar ha "frontMatter": {}, "id": "API/Core APIs/Server API", "isDraft": false, - "isUnlisted": false, "lastUpdatedAt": undefined, "lastUpdatedBy": undefined, "next": { @@ -2023,7 +1979,6 @@ exports[`site with full autogenerated sidebar docs in fully generated sidebar ha "frontMatter": {}, "id": "API/Extension APIs/Plugin API", "isDraft": false, - "isUnlisted": false, "lastUpdatedAt": undefined, "lastUpdatedBy": undefined, "next": { @@ -2055,7 +2010,6 @@ exports[`site with full autogenerated sidebar docs in fully generated sidebar ha "frontMatter": {}, "id": "API/Extension APIs/Theme API", "isDraft": false, - "isUnlisted": false, "lastUpdatedAt": undefined, "lastUpdatedBy": undefined, "next": { @@ -2087,7 +2041,6 @@ exports[`site with full autogenerated sidebar docs in fully generated sidebar ha "frontMatter": {}, "id": "API/api-end", "isDraft": false, - "isUnlisted": false, "lastUpdatedAt": undefined, "lastUpdatedBy": undefined, "next": undefined, @@ -2268,7 +2221,6 @@ exports[`site with partial autogenerated sidebars docs in partially generated si "frontMatter": {}, "id": "API/api-end", "isDraft": false, - "isUnlisted": false, "lastUpdatedAt": undefined, "lastUpdatedBy": undefined, "next": { @@ -2297,7 +2249,6 @@ exports[`site with partial autogenerated sidebars docs in partially generated si "frontMatter": {}, "id": "API/api-overview", "isDraft": false, - "isUnlisted": false, "lastUpdatedAt": undefined, "lastUpdatedBy": undefined, "next": { @@ -2329,7 +2280,6 @@ exports[`site with partial autogenerated sidebars docs in partially generated si "frontMatter": {}, "id": "API/Extension APIs/Plugin API", "isDraft": false, - "isUnlisted": false, "lastUpdatedAt": undefined, "lastUpdatedBy": undefined, "next": { @@ -2361,7 +2311,6 @@ exports[`site with partial autogenerated sidebars docs in partially generated si "frontMatter": {}, "id": "API/Extension APIs/Theme API", "isDraft": false, - "isUnlisted": false, "lastUpdatedAt": undefined, "lastUpdatedBy": undefined, "next": undefined, @@ -2424,7 +2373,6 @@ exports[`versioned website (community) content 1`] = ` }, "id": "team", "isDraft": false, - "isUnlisted": false, "lastUpdatedAt": undefined, "lastUpdatedBy": undefined, "next": undefined, @@ -2450,7 +2398,6 @@ exports[`versioned website (community) content 2`] = ` "frontMatter": {}, "id": "version-1.0.0/team", "isDraft": false, - "isUnlisted": false, "lastUpdatedAt": undefined, "lastUpdatedBy": undefined, "next": undefined, @@ -2505,7 +2452,6 @@ exports[`versioned website (community) content: data 1`] = ` \\"version\\": \\"1.0.0\\", \\"frontMatter\\": {}, \\"isDraft\\": false, - \\"isUnlisted\\": false, \\"sidebar\\": \\"version-1.0.0/community\\" }", "site-i-18-n-en-docusaurus-plugin-content-docs-community-current-team-md-7e5.json": "{ @@ -2523,7 +2469,6 @@ exports[`versioned website (community) content: data 1`] = ` \\"title\\": \\"Team title translated\\" }, \\"isDraft\\": false, - \\"isUnlisted\\": false, \\"sidebar\\": \\"community\\" }", "version-1-0-0-metadata-prop-608.json": "{ @@ -2716,7 +2661,6 @@ exports[`versioned website content 1`] = ` }, "id": "foo/bar", "isDraft": false, - "isUnlisted": false, "lastUpdatedAt": undefined, "lastUpdatedBy": undefined, "next": { @@ -2758,7 +2702,6 @@ exports[`versioned website content 2`] = ` "frontMatter": {}, "id": "version-1.0.1/foo/bar", "isDraft": false, - "isUnlisted": false, "lastUpdatedAt": undefined, "lastUpdatedBy": undefined, "next": { @@ -2789,7 +2732,6 @@ exports[`versioned website content 3`] = ` }, "id": "hello", "isDraft": false, - "isUnlisted": false, "lastUpdatedAt": undefined, "lastUpdatedBy": undefined, "next": undefined, @@ -2820,7 +2762,6 @@ exports[`versioned website content 4`] = ` }, "id": "version-1.0.1/hello", "isDraft": false, - "isUnlisted": false, "lastUpdatedAt": undefined, "lastUpdatedBy": undefined, "next": undefined, @@ -2849,7 +2790,6 @@ exports[`versioned website content 5`] = ` "frontMatter": {}, "id": "version-1.0.0/foo/baz", "isDraft": false, - "isUnlisted": false, "lastUpdatedAt": undefined, "lastUpdatedBy": undefined, "next": { @@ -3014,7 +2954,6 @@ exports[`versioned website content: data 1`] = ` ] }, \\"isDraft\\": false, - \\"isUnlisted\\": false, \\"sidebar\\": \\"docs\\", \\"next\\": { \\"title\\": \\"hello\\", @@ -3036,7 +2975,6 @@ exports[`versioned website content: data 1`] = ` \\"slug\\": \\"/\\" }, \\"isDraft\\": false, - \\"isUnlisted\\": false, \\"sidebar\\": \\"docs\\", \\"previous\\": { \\"title\\": \\"bar\\", @@ -3057,8 +2995,7 @@ exports[`versioned website content: data 1`] = ` \\"frontMatter\\": { \\"slug\\": \\"/absoluteSlug\\" }, - \\"isDraft\\": false, - \\"isUnlisted\\": false + \\"isDraft\\": false }", "site-docs-slugs-relative-slug-md-d1c.json": "{ \\"unversionedId\\": \\"slugs/relativeSlug\\", @@ -3074,8 +3011,7 @@ exports[`versioned website content: data 1`] = ` \\"frontMatter\\": { \\"slug\\": \\"relativeSlug\\" }, - \\"isDraft\\": false, - \\"isUnlisted\\": false + \\"isDraft\\": false }", "site-docs-slugs-resolved-slug-md-02b.json": "{ \\"unversionedId\\": \\"slugs/resolvedSlug\\", @@ -3091,8 +3027,7 @@ exports[`versioned website content: data 1`] = ` \\"frontMatter\\": { \\"slug\\": \\"./hey/ho/../resolvedSlug\\" }, - \\"isDraft\\": false, - \\"isUnlisted\\": false + \\"isDraft\\": false }", "site-docs-slugs-try-to-escape-slug-md-70d.json": "{ \\"unversionedId\\": \\"slugs/tryToEscapeSlug\\", @@ -3108,8 +3043,7 @@ exports[`versioned website content: data 1`] = ` \\"frontMatter\\": { \\"slug\\": \\"../../../../../../../../tryToEscapeSlug\\" }, - \\"isDraft\\": false, - \\"isUnlisted\\": false + \\"isDraft\\": false }", "site-i-18-n-en-docusaurus-plugin-content-docs-version-1-0-0-hello-md-fe5.json": "{ \\"unversionedId\\": \\"hello\\", @@ -3126,7 +3060,6 @@ exports[`versioned website content: data 1`] = ` \\"slug\\": \\"/\\" }, \\"isDraft\\": false, - \\"isUnlisted\\": false, \\"sidebar\\": \\"version-1.0.0/docs\\", \\"previous\\": { \\"title\\": \\"baz\\", @@ -3148,7 +3081,6 @@ exports[`versioned website content: data 1`] = ` \\"slug\\": \\"barSlug\\" }, \\"isDraft\\": false, - \\"isUnlisted\\": false, \\"sidebar\\": \\"version-1.0.0/docs\\", \\"next\\": { \\"title\\": \\"baz\\", @@ -3168,7 +3100,6 @@ exports[`versioned website content: data 1`] = ` \\"version\\": \\"1.0.0\\", \\"frontMatter\\": {}, \\"isDraft\\": false, - \\"isUnlisted\\": false, \\"sidebar\\": \\"version-1.0.0/docs\\", \\"previous\\": { \\"title\\": \\"bar\\", @@ -3192,7 +3123,6 @@ exports[`versioned website content: data 1`] = ` \\"version\\": \\"1.0.1\\", \\"frontMatter\\": {}, \\"isDraft\\": false, - \\"isUnlisted\\": false, \\"sidebar\\": \\"VersionedSideBarNameDoesNotMatter/docs\\", \\"next\\": { \\"title\\": \\"hello\\", @@ -3214,7 +3144,6 @@ exports[`versioned website content: data 1`] = ` \\"slug\\": \\"/\\" }, \\"isDraft\\": false, - \\"isUnlisted\\": false, \\"sidebar\\": \\"VersionedSideBarNameDoesNotMatter/docs\\", \\"previous\\": { \\"title\\": \\"bar\\", @@ -3236,7 +3165,6 @@ exports[`versioned website content: data 1`] = ` \\"slug\\": \\"/rootAbsoluteSlug\\" }, \\"isDraft\\": false, - \\"isUnlisted\\": false, \\"sidebar\\": \\"version-1.0.1/docs\\" }", "site-versioned-docs-version-with-slugs-root-relative-slug-md-32a.json": "{ @@ -3253,8 +3181,7 @@ exports[`versioned website content: data 1`] = ` \\"frontMatter\\": { \\"slug\\": \\"rootRelativeSlug\\" }, - \\"isDraft\\": false, - \\"isUnlisted\\": false + \\"isDraft\\": false }", "site-versioned-docs-version-with-slugs-root-resolved-slug-md-aee.json": "{ \\"unversionedId\\": \\"rootResolvedSlug\\", @@ -3270,8 +3197,7 @@ exports[`versioned website content: data 1`] = ` \\"frontMatter\\": { \\"slug\\": \\"./hey/ho/../rootResolvedSlug\\" }, - \\"isDraft\\": false, - \\"isUnlisted\\": false + \\"isDraft\\": false }", "site-versioned-docs-version-with-slugs-root-try-to-escape-slug-md-b5d.json": "{ \\"unversionedId\\": \\"rootTryToEscapeSlug\\", @@ -3287,8 +3213,7 @@ exports[`versioned website content: data 1`] = ` \\"frontMatter\\": { \\"slug\\": \\"../../../../../../../../rootTryToEscapeSlug\\" }, - \\"isDraft\\": false, - \\"isUnlisted\\": false + \\"isDraft\\": false }", "site-versioned-docs-version-with-slugs-slugs-absolute-slug-md-47a.json": "{ \\"unversionedId\\": \\"slugs/absoluteSlug\\", @@ -3304,8 +3229,7 @@ exports[`versioned website content: data 1`] = ` \\"frontMatter\\": { \\"slug\\": \\"/absoluteSlug\\" }, - \\"isDraft\\": false, - \\"isUnlisted\\": false + \\"isDraft\\": false }", "site-versioned-docs-version-with-slugs-slugs-relative-slug-md-a95.json": "{ \\"unversionedId\\": \\"slugs/relativeSlug\\", @@ -3321,8 +3245,7 @@ exports[`versioned website content: data 1`] = ` \\"frontMatter\\": { \\"slug\\": \\"relativeSlug\\" }, - \\"isDraft\\": false, - \\"isUnlisted\\": false + \\"isDraft\\": false }", "site-versioned-docs-version-with-slugs-slugs-resolved-slug-md-5a1.json": "{ \\"unversionedId\\": \\"slugs/resolvedSlug\\", @@ -3338,8 +3261,7 @@ exports[`versioned website content: data 1`] = ` \\"frontMatter\\": { \\"slug\\": \\"./hey/ho/../resolvedSlug\\" }, - \\"isDraft\\": false, - \\"isUnlisted\\": false + \\"isDraft\\": false }", "site-versioned-docs-version-with-slugs-slugs-try-to-escape-slug-md-4e1.json": "{ \\"unversionedId\\": \\"slugs/tryToEscapeSlug\\", @@ -3355,8 +3277,7 @@ exports[`versioned website content: data 1`] = ` \\"frontMatter\\": { \\"slug\\": \\"../../../../../../../../tryToEscapeSlug\\" }, - \\"isDraft\\": false, - \\"isUnlisted\\": false + \\"isDraft\\": false }", "tag-docs-next-tags-bar-tag-1-a8f.json": "{ \\"name\\": \\"barTag 1\\", diff --git a/packages/docusaurus-plugin-content-docs/src/__tests__/docFrontMatter.test.ts b/packages/docusaurus-plugin-content-docs/src/__tests__/docFrontMatter.test.ts index 081b5746104d0..96eff8ea89b18 100644 --- a/packages/docusaurus-plugin-content-docs/src/__tests__/docFrontMatter.test.ts +++ b/packages/docusaurus-plugin-content-docs/src/__tests__/docFrontMatter.test.ts @@ -391,19 +391,3 @@ describe('validateDocFrontMatter draft', () => { ], }); }); - -describe('validateDocFrontMatter unlisted', () => { - testField({ - prefix: 'unlisted', - validFrontMatters: [{unlisted: true}, {unlisted: false}], - convertibleFrontMatter: [ - [{unlisted: 'true'}, {unlisted: true}], - [{unlisted: 'false'}, {unlisted: false}], - ], - invalidFrontMatters: [ - [{unlisted: 'yes'}, 'must be a boolean'], - [{unlisted: 'no'}, 'must be a boolean'], - [{unlisted: ''}, 'must be a boolean'], - ], - }); -}); diff --git a/packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts b/packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts index 193dac61ae4d3..1a5380897c6a0 100644 --- a/packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts +++ b/packages/docusaurus-plugin-content-docs/src/__tests__/docs.test.ts @@ -240,7 +240,6 @@ describe('simple site', () => { }, tags: [], isDraft: false, - isUnlisted: false, }); await defaultTestUtils.testMeta(path.join('hello.md'), { version: 'current', @@ -269,7 +268,6 @@ describe('simple site', () => { }, ], isDraft: false, - isUnlisted: false, }); }); @@ -320,7 +318,6 @@ describe('simple site', () => { }, ], isDraft: false, - isUnlisted: false, }); }); @@ -343,7 +340,6 @@ describe('simple site', () => { }, tags: [], isDraft: false, - isUnlisted: false, }); }); @@ -397,7 +393,6 @@ describe('simple site', () => { }, ], isDraft: false, - isUnlisted: false, }); expect(editUrlFunction).toHaveBeenCalledTimes(1); @@ -444,7 +439,6 @@ describe('simple site', () => { lastUpdatedBy: 'Author', tags: [], isDraft: false, - isUnlisted: false, }); }); @@ -470,7 +464,6 @@ describe('simple site', () => { }, tags: [], isDraft: true, - isUnlisted: false, }); }); @@ -654,7 +647,6 @@ describe('versioned site', () => { }, ], isDraft: false, - isUnlisted: false, }); await currentVersionTestUtils.testMeta(path.join('hello.md'), { id: 'hello', @@ -670,7 +662,6 @@ describe('versioned site', () => { }, tags: [], isDraft: false, - isUnlisted: false, }); }); @@ -689,7 +680,6 @@ describe('versioned site', () => { version: '1.0.0', tags: [], isDraft: false, - isUnlisted: false, }); await version100TestUtils.testMeta(path.join('hello.md'), { id: 'version-1.0.0/hello', @@ -707,7 +697,6 @@ describe('versioned site', () => { '@site/i18n/en/docusaurus-plugin-content-docs/version-1.0.0/hello.md', tags: [], isDraft: false, - isUnlisted: false, }); await version101TestUtils.testMeta(path.join('foo', 'bar.md'), { id: 'version-1.0.1/foo/bar', @@ -721,7 +710,6 @@ describe('versioned site', () => { frontMatter: {}, tags: [], isDraft: false, - isUnlisted: false, }); await version101TestUtils.testMeta(path.join('hello.md'), { id: 'version-1.0.1/hello', @@ -737,7 +725,6 @@ describe('versioned site', () => { }, tags: [], isDraft: false, - isUnlisted: false, }); }); @@ -835,7 +822,6 @@ describe('versioned site', () => { editUrl: hardcodedEditUrl, tags: [], isDraft: false, - isUnlisted: false, }); expect(editUrlFunction).toHaveBeenCalledTimes(1); @@ -881,7 +867,6 @@ describe('versioned site', () => { 'https://github.com/facebook/docusaurus/edit/main/website/versioned_docs/version-1.0.0/hello.md', tags: [], isDraft: false, - isUnlisted: false, }); }); @@ -918,7 +903,6 @@ describe('versioned site', () => { 'https://github.com/facebook/docusaurus/edit/main/website/docs/hello.md', tags: [], isDraft: false, - isUnlisted: false, }); }); @@ -956,7 +940,6 @@ describe('versioned site', () => { 'https://github.com/facebook/docusaurus/edit/main/website/i18n/fr/docusaurus-plugin-content-docs/version-1.0.0/hello.md', tags: [], isDraft: false, - isUnlisted: false, }); }); @@ -995,7 +978,6 @@ describe('versioned site', () => { 'https://github.com/facebook/docusaurus/edit/main/website/i18n/fr/docusaurus-plugin-content-docs/current/hello.md', tags: [], isDraft: false, - isUnlisted: false, }); }); }); diff --git a/packages/docusaurus-plugin-content-docs/src/docFrontMatter.ts b/packages/docusaurus-plugin-content-docs/src/docFrontMatter.ts index 73c46f44d1b58..0cd6b767a9081 100644 --- a/packages/docusaurus-plugin-content-docs/src/docFrontMatter.ts +++ b/packages/docusaurus-plugin-content-docs/src/docFrontMatter.ts @@ -39,7 +39,6 @@ const DocFrontMatterSchema = Joi.object({ pagination_next: Joi.string().allow(null), pagination_prev: Joi.string().allow(null), draft: Joi.boolean(), - unlisted: Joi.boolean(), ...FrontMatterTOCHeadingLevels, }).unknown(); diff --git a/packages/docusaurus-plugin-content-docs/src/docs.ts b/packages/docusaurus-plugin-content-docs/src/docs.ts index 98aab6a8e6d04..c662c2bc8cb1c 100644 --- a/packages/docusaurus-plugin-content-docs/src/docs.ts +++ b/packages/docusaurus-plugin-content-docs/src/docs.ts @@ -137,7 +137,6 @@ function doProcessDocMetadata({ const isDraft = (frontMatter.draft && process.env.NODE_ENV === 'production') || false; - const isUnlisted = frontMatter.unlisted || false; const { custom_edit_url: customEditURL, @@ -269,7 +268,6 @@ function doProcessDocMetadata({ sidebarPosition, frontMatter, isDraft, - isUnlisted, }; } diff --git a/packages/docusaurus-plugin-content-docs/src/sidebars/__tests__/generator.test.ts b/packages/docusaurus-plugin-content-docs/src/sidebars/__tests__/generator.test.ts index 0d1fc0203ace4..013d8e50bf965 100644 --- a/packages/docusaurus-plugin-content-docs/src/sidebars/__tests__/generator.test.ts +++ b/packages/docusaurus-plugin-content-docs/src/sidebars/__tests__/generator.test.ts @@ -546,46 +546,4 @@ describe('DefaultSidebarItemsGenerator', () => { expect(sidebarSlice).toEqual([{type: 'doc', id: 'doc2'}] as Sidebar); }); - - test('excludes items for unlisted docs', async () => { - const sidebarSlice = await DefaultSidebarItemsGenerator({ - numberPrefixParser: DefaultNumberPrefixParser, - item: { - type: 'autogenerated', - dirName: '.', - }, - version: { - versionName: 'current', - contentPath: '', - }, - docs: [ - { - id: 'doc1', - source: 'doc1.md', - sourceDirName: '.', - sidebarPosition: 1, - frontMatter: { - unlisted: true, - }, - isUnlisted: true, - }, - { - id: 'doc2', - source: 'doc2.md', - sourceDirName: '.', - sidebarPosition: 2, - frontMatter: { - unlisted: false, - }, - isUnlisted: false, - }, - ], - options: { - sidebarCollapsed: true, - sidebarCollapsible: true, - }, - }); - - expect(sidebarSlice).toEqual([{type: 'doc', id: 'doc2'}] as Sidebar); - }); }); diff --git a/packages/docusaurus-plugin-content-docs/src/sidebars/__tests__/processor.test.ts b/packages/docusaurus-plugin-content-docs/src/sidebars/__tests__/processor.test.ts index e77296d4387a6..d0a485acf89d7 100644 --- a/packages/docusaurus-plugin-content-docs/src/sidebars/__tests__/processor.test.ts +++ b/packages/docusaurus-plugin-content-docs/src/sidebars/__tests__/processor.test.ts @@ -279,33 +279,4 @@ describe('processSidebars', () => { someSidebar: [{type: 'doc', id: 'doc2'}], }); }); - - test('excludes items for unlisted docs', async () => { - const unprocessedSidebars: NormalizedSidebars = { - someSidebar: [ - {type: 'doc', id: 'doc1'}, - {type: 'doc', id: 'doc2'}, - ], - }; - - const processedSidebar = await testProcessSidebars( - unprocessedSidebars, - {}, - { - docs: [ - { - id: 'doc1', - isUnlisted: true, - }, - { - id: 'doc2', - isUnlisted: false, - }, - ], - }, - ); - expect(processedSidebar).toEqual({ - someSidebar: [{type: 'doc', id: 'doc2'}], - }); - }); }); diff --git a/packages/docusaurus-plugin-content-docs/src/sidebars/generator.ts b/packages/docusaurus-plugin-content-docs/src/sidebars/generator.ts index c1b230f794b9c..dc0e3fe257c30 100644 --- a/packages/docusaurus-plugin-content-docs/src/sidebars/generator.ts +++ b/packages/docusaurus-plugin-content-docs/src/sidebars/generator.ts @@ -18,7 +18,6 @@ import {addTrailingSlash, posixPath} from '@docusaurus/utils'; import logger from '@docusaurus/logger'; import path from 'path'; import {createDocsByIdIndex, toCategoryIndexMatcherParam} from '../docs'; -import {docIsInvisible} from './utils'; const BreadcrumbSeparator = '/'; @@ -54,7 +53,7 @@ export const DefaultSidebarItemsGenerator: SidebarItemsGenerator = async ({ item: {dirName: autogenDir}, categoriesMetadata, }) => { - const visibleDocs = allDocs.filter((doc) => !docIsInvisible(doc)); + const visibleDocs = allDocs.filter((doc) => !doc.isDraft); const docsById = createDocsByIdIndex(visibleDocs); const findDoc = (docId: string): SidebarItemsGeneratorDoc | undefined => docsById[docId]; diff --git a/packages/docusaurus-plugin-content-docs/src/sidebars/processor.ts b/packages/docusaurus-plugin-content-docs/src/sidebars/processor.ts index 34c4d4cd225fa..80bb6b67ac46c 100644 --- a/packages/docusaurus-plugin-content-docs/src/sidebars/processor.ts +++ b/packages/docusaurus-plugin-content-docs/src/sidebars/processor.ts @@ -19,7 +19,6 @@ import type { SidebarProcessorParams, CategoryMetadataFile, } from './types'; -import {docIsInvisible} from './utils'; import {DefaultSidebarItemsGenerator} from './generator'; import {validateSidebars} from './validation'; import _ from 'lodash'; @@ -37,7 +36,6 @@ function toSidebarItemsGeneratorDoc( 'sourceDirName', 'sidebarPosition', 'isDraft', - 'isUnlisted', ]); } @@ -103,7 +101,7 @@ async function processSidebar( } if ( item.type === 'doc' && - docIsInvisible(docs.find((doc) => doc.id === item.id)) + docs.find((doc) => doc.id === item.id)?.isDraft ) { return []; } diff --git a/packages/docusaurus-plugin-content-docs/src/sidebars/types.ts b/packages/docusaurus-plugin-content-docs/src/sidebars/types.ts index 4e094efe19f89..8fc7dd01a1a45 100644 --- a/packages/docusaurus-plugin-content-docs/src/sidebars/types.ts +++ b/packages/docusaurus-plugin-content-docs/src/sidebars/types.ts @@ -236,7 +236,6 @@ export type SidebarItemsGeneratorDoc = Pick< | 'sourceDirName' | 'sidebarPosition' | 'isDraft' - | 'isUnlisted' >; export type SidebarItemsGeneratorVersion = Pick< VersionMetadata, diff --git a/packages/docusaurus-plugin-content-docs/src/sidebars/utils.ts b/packages/docusaurus-plugin-content-docs/src/sidebars/utils.ts index 8eb25601b92b8..ee5de8bb582e9 100644 --- a/packages/docusaurus-plugin-content-docs/src/sidebars/utils.ts +++ b/packages/docusaurus-plugin-content-docs/src/sidebars/utils.ts @@ -17,7 +17,6 @@ import type { SidebarItemConfig, SidebarItemCategoryWithGeneratedIndex, SidebarNavigationItem, - SidebarItemsGeneratorDoc, } from './types'; import _ from 'lodash'; @@ -387,7 +386,3 @@ export function toNavigationLink( } return toDocNavigationLink(getDocById(navigationItem.id)); } - -export function docIsInvisible(doc?: SidebarItemsGeneratorDoc): boolean { - return doc ? doc.isDraft || doc.isUnlisted : false; -} diff --git a/packages/docusaurus-plugin-content-docs/src/types.ts b/packages/docusaurus-plugin-content-docs/src/types.ts index b6888dff832a3..1b06fa79061ba 100644 --- a/packages/docusaurus-plugin-content-docs/src/types.ts +++ b/packages/docusaurus-plugin-content-docs/src/types.ts @@ -68,7 +68,6 @@ export type DocFrontMatter = { pagination_next?: string | null; pagination_prev?: string | null; draft?: boolean; - unlisted?: boolean; }; export type DocMetadataBase = LastUpdateData & { @@ -86,7 +85,6 @@ export type DocMetadataBase = LastUpdateData & { tags: Tag[]; frontMatter: DocFrontMatter & Record; isDraft: boolean; - isUnlisted: boolean; }; export type DocNavLink = { diff --git a/website/docs/api/plugins/plugin-content-docs.md b/website/docs/api/plugins/plugin-content-docs.md index 18a062d5fac77..91f2578555865 100644 --- a/website/docs/api/plugins/plugin-content-docs.md +++ b/website/docs/api/plugins/plugin-content-docs.md @@ -236,7 +236,6 @@ Accepted fields: | `slug` | `string` | File path | Allows to customize the document url (`//`). Support multiple patterns: `slug: my-doc`, `slug: /my/path/myDoc`, `slug: /`. | | `tags` | `Tag[]` | `undefined` | A list of strings or objects of two string fields `label` and `permalink` to tag to your docs. | | `draft` | `boolean` | `false` | Whether to exclude this document from production builds and sidebars. | -| `unlisted` | `boolean` | `false` | Whether to exclude this document from sidebars, while remaining accessible with the direct URL. |