Skip to content

Commit

Permalink
fix(v2): deprecate docs homePageId in favor of frontmatter "slug: /" (#…
Browse files Browse the repository at this point in the history
…3228)

* homePageId => deprecated

* docs prettier
  • Loading branch information
slorber committed Aug 6, 2020
1 parent 0079f0e commit 0a33a52
Show file tree
Hide file tree
Showing 25 changed files with 106 additions and 76 deletions.
1 change: 1 addition & 0 deletions packages/docusaurus-init/templates/bootstrap/docs/doc1.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
id: doc1
title: Style Guide
sidebar_label: Style Guide
slug: /
---

You can write content using [GitHub-flavored Markdown syntax](https://github.github.com/gfm/).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ module.exports = {
'@docusaurus/preset-bootstrap',
{
docs: {
// It is recommended to set document id as docs home page (`docs/` path).
homePageId: 'doc1',
sidebarPath: require.resolve('./sidebars.js'),
editUrl:
'https://github.com/facebook/docusaurus/edit/master/website/',
Expand Down
1 change: 1 addition & 0 deletions packages/docusaurus-init/templates/classic/docs/doc1.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
id: doc1
title: Style Guide
sidebar_label: Style Guide
slug: /
---

You can write content using [GitHub-flavored Markdown syntax](https://github.github.com/gfm/).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ module.exports = {
'@docusaurus/preset-classic',
{
docs: {
// It is recommended to set document id as docs home page (`docs/` path).
homePageId: 'doc1',
sidebarPath: require.resolve('./sidebars.js'),
// Please change this to your repo.
editUrl:
Expand Down
1 change: 1 addition & 0 deletions packages/docusaurus-init/templates/facebook/docs/doc1.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
id: doc1
title: Style Guide
sidebar_label: Style Guide
slug: /
---

You can write content using [GitHub-flavored Markdown syntax](https://github.github.com/gfm/).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,6 @@ module.exports = {
'@docusaurus/preset-classic',
{
docs: {
// It is recommended to set document id as docs home page (`docs/` path).
homePageId: 'doc1',
sidebarPath: require.resolve('./sidebars.js'),
// Please change this to your repo.
editUrl:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ Object {
\\"title\\": \\"Bar\\",
\\"description\\": \\"This is custom description\\",
\\"source\\": \\"@site/docs/foo/bar.md\\",
\\"slug\\": \\"/foo/bar\\",
\\"permalink\\": \\"/docs/foo/bar\\",
\\"sidebar\\": \\"docs\\",
\\"next\\": {
Expand All @@ -206,6 +207,7 @@ Object {
\\"title\\": \\"baz\\",
\\"description\\": \\"Images\\",
\\"source\\": \\"@site/docs/foo/baz.md\\",
\\"slug\\": \\"/foo/bazSlug.html\\",
\\"permalink\\": \\"/docs/foo/bazSlug.html\\",
\\"sidebar\\": \\"docs\\",
\\"previous\\": {
Expand All @@ -224,6 +226,7 @@ Object {
\\"title\\": \\"Hello, World !\\",
\\"description\\": \\"Hi, Endilie here :)\\",
\\"source\\": \\"@site/docs/hello.md\\",
\\"slug\\": \\"/\\",
\\"permalink\\": \\"/docs/\\",
\\"sidebar\\": \\"docs\\",
\\"previous\\": {
Expand All @@ -238,6 +241,7 @@ Object {
\\"title\\": \\"ipsum\\",
\\"description\\": \\"Lorem ipsum.\\",
\\"source\\": \\"@site/docs/ipsum.md\\",
\\"slug\\": \\"/ipsum\\",
\\"permalink\\": \\"/docs/ipsum\\",
\\"editUrl\\": null
}",
Expand All @@ -248,6 +252,7 @@ Object {
\\"title\\": \\"lorem\\",
\\"description\\": \\"Lorem ipsum.\\",
\\"source\\": \\"@site/docs/lorem.md\\",
\\"slug\\": \\"/lorem\\",
\\"permalink\\": \\"/docs/lorem\\",
\\"editUrl\\": \\"https://github.com/customUrl/docs/lorem.md\\"
}",
Expand All @@ -258,6 +263,7 @@ Object {
\\"title\\": \\"rootAbsoluteSlug\\",
\\"description\\": \\"Lorem\\",
\\"source\\": \\"@site/docs/rootAbsoluteSlug.md\\",
\\"slug\\": \\"/rootAbsoluteSlug\\",
\\"permalink\\": \\"/docs/rootAbsoluteSlug\\"
}",
"site-docs-root-relative-slug-md-3dd.json": "{
Expand All @@ -267,6 +273,7 @@ Object {
\\"title\\": \\"rootRelativeSlug\\",
\\"description\\": \\"Lorem\\",
\\"source\\": \\"@site/docs/rootRelativeSlug.md\\",
\\"slug\\": \\"/rootRelativeSlug\\",
\\"permalink\\": \\"/docs/rootRelativeSlug\\"
}",
"site-docs-root-resolved-slug-md-4d1.json": "{
Expand All @@ -276,6 +283,7 @@ Object {
\\"title\\": \\"rootResolvedSlug\\",
\\"description\\": \\"Lorem\\",
\\"source\\": \\"@site/docs/rootResolvedSlug.md\\",
\\"slug\\": \\"/hey/rootResolvedSlug\\",
\\"permalink\\": \\"/docs/hey/rootResolvedSlug\\"
}",
"site-docs-root-try-to-escape-slug-md-9ee.json": "{
Expand All @@ -285,6 +293,7 @@ Object {
\\"title\\": \\"rootTryToEscapeSlug\\",
\\"description\\": \\"Lorem\\",
\\"source\\": \\"@site/docs/rootTryToEscapeSlug.md\\",
\\"slug\\": \\"/rootTryToEscapeSlug\\",
\\"permalink\\": \\"/docs/rootTryToEscapeSlug\\"
}",
"site-docs-slugs-absolute-slug-md-4e8.json": "{
Expand All @@ -294,6 +303,7 @@ Object {
\\"title\\": \\"absoluteSlug\\",
\\"description\\": \\"Lorem\\",
\\"source\\": \\"@site/docs/slugs/absoluteSlug.md\\",
\\"slug\\": \\"/absoluteSlug\\",
\\"permalink\\": \\"/docs/absoluteSlug\\"
}",
"site-docs-slugs-relative-slug-md-d1c.json": "{
Expand All @@ -303,6 +313,7 @@ Object {
\\"title\\": \\"relativeSlug\\",
\\"description\\": \\"Lorem\\",
\\"source\\": \\"@site/docs/slugs/relativeSlug.md\\",
\\"slug\\": \\"/slugs/relativeSlug\\",
\\"permalink\\": \\"/docs/slugs/relativeSlug\\"
}",
"site-docs-slugs-resolved-slug-md-02b.json": "{
Expand All @@ -312,6 +323,7 @@ Object {
\\"title\\": \\"resolvedSlug\\",
\\"description\\": \\"Lorem\\",
\\"source\\": \\"@site/docs/slugs/resolvedSlug.md\\",
\\"slug\\": \\"/slugs/hey/resolvedSlug\\",
\\"permalink\\": \\"/docs/slugs/hey/resolvedSlug\\"
}",
"site-docs-slugs-try-to-escape-slug-md-70d.json": "{
Expand All @@ -321,6 +333,7 @@ Object {
\\"title\\": \\"tryToEscapeSlug\\",
\\"description\\": \\"Lorem\\",
\\"source\\": \\"@site/docs/slugs/tryToEscapeSlug.md\\",
\\"slug\\": \\"/tryToEscapeSlug\\",
\\"permalink\\": \\"/docs/tryToEscapeSlug\\"
}",
}
Expand Down Expand Up @@ -630,6 +643,7 @@ Object {
\\"title\\": \\"team\\",
\\"description\\": \\"Team current version\\",
\\"source\\": \\"@site/community/team.md\\",
\\"slug\\": \\"/team\\",
\\"permalink\\": \\"/community/next/team\\",
\\"version\\": \\"next\\",
\\"sidebar\\": \\"community\\"
Expand All @@ -641,6 +655,7 @@ Object {
\\"title\\": \\"team\\",
\\"description\\": \\"Team 1.0.0\\",
\\"source\\": \\"@site/community_versioned_docs/version-1.0.0/team.md\\",
\\"slug\\": \\"/team\\",
\\"permalink\\": \\"/community/team\\",
\\"version\\": \\"1.0.0\\",
\\"sidebar\\": \\"version-1.0.0/community\\"
Expand Down Expand Up @@ -1070,6 +1085,7 @@ Object {
\\"title\\": \\"bar\\",
\\"description\\": \\"This is next version of bar.\\",
\\"source\\": \\"@site/docs/foo/bar.md\\",
\\"slug\\": \\"/foo/barSlug\\",
\\"permalink\\": \\"/docs/next/foo/barSlug\\",
\\"version\\": \\"next\\",
\\"sidebar\\": \\"docs\\",
Expand All @@ -1085,6 +1101,7 @@ Object {
\\"title\\": \\"hello\\",
\\"description\\": \\"Hello next !\\",
\\"source\\": \\"@site/docs/hello.md\\",
\\"slug\\": \\"/\\",
\\"permalink\\": \\"/docs/next/\\",
\\"version\\": \\"next\\",
\\"sidebar\\": \\"docs\\",
Expand All @@ -1100,6 +1117,7 @@ Object {
\\"title\\": \\"absoluteSlug\\",
\\"description\\": \\"Lorem\\",
\\"source\\": \\"@site/docs/slugs/absoluteSlug.md\\",
\\"slug\\": \\"/absoluteSlug\\",
\\"permalink\\": \\"/docs/next/absoluteSlug\\",
\\"version\\": \\"next\\"
}",
Expand All @@ -1110,6 +1128,7 @@ Object {
\\"title\\": \\"relativeSlug\\",
\\"description\\": \\"Lorem\\",
\\"source\\": \\"@site/docs/slugs/relativeSlug.md\\",
\\"slug\\": \\"/slugs/relativeSlug\\",
\\"permalink\\": \\"/docs/next/slugs/relativeSlug\\",
\\"version\\": \\"next\\"
}",
Expand All @@ -1120,6 +1139,7 @@ Object {
\\"title\\": \\"resolvedSlug\\",
\\"description\\": \\"Lorem\\",
\\"source\\": \\"@site/docs/slugs/resolvedSlug.md\\",
\\"slug\\": \\"/slugs/hey/resolvedSlug\\",
\\"permalink\\": \\"/docs/next/slugs/hey/resolvedSlug\\",
\\"version\\": \\"next\\"
}",
Expand All @@ -1130,6 +1150,7 @@ Object {
\\"title\\": \\"tryToEscapeSlug\\",
\\"description\\": \\"Lorem\\",
\\"source\\": \\"@site/docs/slugs/tryToEscapeSlug.md\\",
\\"slug\\": \\"/tryToEscapeSlug\\",
\\"permalink\\": \\"/docs/next/tryToEscapeSlug\\",
\\"version\\": \\"next\\"
}",
Expand All @@ -1140,6 +1161,7 @@ Object {
\\"title\\": \\"bar\\",
\\"description\\": \\"Bar 1.0.0 !\\",
\\"source\\": \\"@site/versioned_docs/version-1.0.0/foo/bar.md\\",
\\"slug\\": \\"/foo/barSlug\\",
\\"permalink\\": \\"/docs/1.0.0/foo/barSlug\\",
\\"version\\": \\"1.0.0\\",
\\"sidebar\\": \\"version-1.0.0/docs\\",
Expand All @@ -1155,6 +1177,7 @@ Object {
\\"title\\": \\"baz\\",
\\"description\\": \\"Baz 1.0.0 ! This will be deleted in next subsequent versions.\\",
\\"source\\": \\"@site/versioned_docs/version-1.0.0/foo/baz.md\\",
\\"slug\\": \\"/foo/baz\\",
\\"permalink\\": \\"/docs/1.0.0/foo/baz\\",
\\"version\\": \\"1.0.0\\",
\\"sidebar\\": \\"version-1.0.0/docs\\",
Expand All @@ -1174,6 +1197,7 @@ Object {
\\"title\\": \\"hello\\",
\\"description\\": \\"Hello 1.0.0 !\\",
\\"source\\": \\"@site/versioned_docs/version-1.0.0/hello.md\\",
\\"slug\\": \\"/\\",
\\"permalink\\": \\"/docs/1.0.0/\\",
\\"version\\": \\"1.0.0\\",
\\"sidebar\\": \\"version-1.0.0/docs\\",
Expand All @@ -1189,6 +1213,7 @@ Object {
\\"title\\": \\"bar\\",
\\"description\\": \\"Bar 1.0.1 !\\",
\\"source\\": \\"@site/versioned_docs/version-1.0.1/foo/bar.md\\",
\\"slug\\": \\"/foo/bar\\",
\\"permalink\\": \\"/docs/foo/bar\\",
\\"version\\": \\"1.0.1\\",
\\"sidebar\\": \\"version-1.0.1/docs\\",
Expand All @@ -1204,6 +1229,7 @@ Object {
\\"title\\": \\"hello\\",
\\"description\\": \\"Hello 1.0.1 !\\",
\\"source\\": \\"@site/versioned_docs/version-1.0.1/hello.md\\",
\\"slug\\": \\"/\\",
\\"permalink\\": \\"/docs/\\",
\\"version\\": \\"1.0.1\\",
\\"sidebar\\": \\"version-1.0.1/docs\\",
Expand All @@ -1219,6 +1245,7 @@ Object {
\\"title\\": \\"rootAbsoluteSlug\\",
\\"description\\": \\"Lorem\\",
\\"source\\": \\"@site/versioned_docs/version-withSlugs/rootAbsoluteSlug.md\\",
\\"slug\\": \\"/rootAbsoluteSlug\\",
\\"permalink\\": \\"/docs/withSlugs/rootAbsoluteSlug\\",
\\"version\\": \\"withSlugs\\"
}",
Expand All @@ -1229,6 +1256,7 @@ Object {
\\"title\\": \\"rootRelativeSlug\\",
\\"description\\": \\"Lorem\\",
\\"source\\": \\"@site/versioned_docs/version-withSlugs/rootRelativeSlug.md\\",
\\"slug\\": \\"/rootRelativeSlug\\",
\\"permalink\\": \\"/docs/withSlugs/rootRelativeSlug\\",
\\"version\\": \\"withSlugs\\"
}",
Expand All @@ -1239,6 +1267,7 @@ Object {
\\"title\\": \\"rootResolvedSlug\\",
\\"description\\": \\"Lorem\\",
\\"source\\": \\"@site/versioned_docs/version-withSlugs/rootResolvedSlug.md\\",
\\"slug\\": \\"/hey/rootResolvedSlug\\",
\\"permalink\\": \\"/docs/withSlugs/hey/rootResolvedSlug\\",
\\"version\\": \\"withSlugs\\"
}",
Expand All @@ -1249,6 +1278,7 @@ Object {
\\"title\\": \\"rootTryToEscapeSlug\\",
\\"description\\": \\"Lorem\\",
\\"source\\": \\"@site/versioned_docs/version-withSlugs/rootTryToEscapeSlug.md\\",
\\"slug\\": \\"/rootTryToEscapeSlug\\",
\\"permalink\\": \\"/docs/withSlugs/rootTryToEscapeSlug\\",
\\"version\\": \\"withSlugs\\"
}",
Expand All @@ -1259,6 +1289,7 @@ Object {
\\"title\\": \\"absoluteSlug\\",
\\"description\\": \\"Lorem\\",
\\"source\\": \\"@site/versioned_docs/version-withSlugs/slugs/absoluteSlug.md\\",
\\"slug\\": \\"/absoluteSlug\\",
\\"permalink\\": \\"/docs/withSlugs/absoluteSlug\\",
\\"version\\": \\"withSlugs\\"
}",
Expand All @@ -1269,6 +1300,7 @@ Object {
\\"title\\": \\"relativeSlug\\",
\\"description\\": \\"Lorem\\",
\\"source\\": \\"@site/versioned_docs/version-withSlugs/slugs/relativeSlug.md\\",
\\"slug\\": \\"/slugs/relativeSlug\\",
\\"permalink\\": \\"/docs/withSlugs/slugs/relativeSlug\\",
\\"version\\": \\"withSlugs\\"
}",
Expand All @@ -1279,6 +1311,7 @@ Object {
\\"title\\": \\"resolvedSlug\\",
\\"description\\": \\"Lorem\\",
\\"source\\": \\"@site/versioned_docs/version-withSlugs/slugs/resolvedSlug.md\\",
\\"slug\\": \\"/slugs/hey/resolvedSlug\\",
\\"permalink\\": \\"/docs/withSlugs/slugs/hey/resolvedSlug\\",
\\"version\\": \\"withSlugs\\"
}",
Expand All @@ -1289,6 +1322,7 @@ Object {
\\"title\\": \\"tryToEscapeSlug\\",
\\"description\\": \\"Lorem\\",
\\"source\\": \\"@site/versioned_docs/version-withSlugs/slugs/tryToEscapeSlug.md\\",
\\"slug\\": \\"/tryToEscapeSlug\\",
\\"permalink\\": \\"/docs/withSlugs/tryToEscapeSlug\\",
\\"version\\": \\"withSlugs\\"
}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ describe('simple website', () => {
unversionedId: 'hello',
isDocsHomePage: true,
permalink: '/docs/',
slug: '/',
previous: {
title: 'baz',
permalink: '/docs/foo/bazSlug.html',
Expand All @@ -224,6 +225,7 @@ describe('simple website', () => {
permalink: '/docs/foo/bazSlug.html',
},
permalink: '/docs/foo/bar',
slug: '/foo/bar',
sidebar: 'docs',
source: path.join('@site', pluginPath, 'foo', 'bar.md'),
title: 'Bar',
Expand Down Expand Up @@ -349,6 +351,7 @@ describe('versioned website', () => {
unversionedId: 'foo/bar',
isDocsHomePage: false,
permalink: '/docs/next/foo/barSlug',
slug: '/foo/barSlug',
source: path.join('@site', routeBasePath, 'foo', 'bar.md'),
title: 'bar',
description: 'This is next version of bar.',
Expand All @@ -364,6 +367,7 @@ describe('versioned website', () => {
unversionedId: 'hello',
isDocsHomePage: true,
permalink: '/docs/next/',
slug: '/',
source: path.join('@site', routeBasePath, 'hello.md'),
title: 'hello',
description: 'Hello next !',
Expand All @@ -379,6 +383,7 @@ describe('versioned website', () => {
unversionedId: 'hello',
isDocsHomePage: true,
permalink: '/docs/',
slug: '/',
source: path.join(
'@site',
path.relative(siteDir, versionedDir),
Expand All @@ -399,6 +404,7 @@ describe('versioned website', () => {
unversionedId: 'foo/baz',
isDocsHomePage: false,
permalink: '/docs/1.0.0/foo/baz',
slug: '/foo/baz',
source: path.join(
'@site',
path.relative(siteDir, versionedDir),
Expand Down Expand Up @@ -552,6 +558,7 @@ describe('versioned website (community)', () => {
unversionedId: 'team',
isDocsHomePage: false,
permalink: '/community/next/team',
slug: '/team',
source: path.join('@site', routeBasePath, 'team.md'),
title: 'team',
description: 'Team current version',
Expand All @@ -563,6 +570,7 @@ describe('versioned website (community)', () => {
unversionedId: 'team',
isDocsHomePage: false,
permalink: '/community/team',
slug: '/team',
source: path.join(
'@site',
path.relative(siteDir, versionedDir),
Expand Down
Loading

0 comments on commit 0a33a52

Please sign in to comment.