@docusaurus/plugin-content-docs 0.0.0-4246 → 0.0.0-4251

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/options.ts CHANGED
@@ -30,7 +30,6 @@ export const DEFAULT_OPTIONS: Omit<PluginOptions, 'id' | 'sidebarPath'> = {
30
30
  path: 'docs', // Path to data on filesystem, relative to site dir.
31
31
  routeBasePath: 'docs', // URL Route.
32
32
  tagsBasePath: 'tags', // URL Tags Route.
33
- homePageId: undefined, // TODO remove soon, deprecated
34
33
  include: ['**/*.{md,mdx}'], // Extensions to include.
35
34
  exclude: GlobExcludeDefault,
36
35
  sidebarItemsGenerator: DefaultSidebarItemsGenerator,
@@ -79,7 +78,11 @@ export const OptionsSchema = Joi.object({
79
78
  // .allow('') ""
80
79
  .default(DEFAULT_OPTIONS.routeBasePath),
81
80
  tagsBasePath: Joi.string().default(DEFAULT_OPTIONS.tagsBasePath),
82
- homePageId: Joi.string().optional(),
81
+ homePageId: Joi.any().forbidden().messages({
82
+ 'any.unknown':
83
+ 'The docs plugin option homePageId is not supported anymore. To make a doc the "home", please add "slug: /" in its front matter. See: https://docusaurus.io/docs/next/docs-introduction#home-page-docs',
84
+ }),
85
+
83
86
  include: Joi.array().items(Joi.string()).default(DEFAULT_OPTIONS.include),
84
87
  exclude: Joi.array().items(Joi.string()).default(DEFAULT_OPTIONS.exclude),
85
88
  sidebarPath: Joi.alternatives().try(
@@ -165,16 +168,6 @@ export function validateOptions({
165
168
  }
166
169
  }
167
170
 
168
- // TODO remove homePageId before end of 2020
169
- // "slug: /" is better because the home doc can be different across versions
170
- if (options.homePageId) {
171
- console.log(
172
- chalk.red(
173
- `The docs plugin option homePageId=${options.homePageId} is deprecated. To make a doc the "home", prefer frontmatter: "slug: /"`,
174
- ),
175
- );
176
- }
177
-
178
171
  const normalizedOptions = validate(OptionsSchema, options);
179
172
 
180
173
  if (normalizedOptions.admonitions) {
package/src/types.ts CHANGED
@@ -50,7 +50,6 @@ export type EditUrlFunction = (editUrlParams: {
50
50
 
51
51
  export type MetadataOptions = {
52
52
  routeBasePath: string;
53
- homePageId?: string;
54
53
  editUrl?: string | EditUrlFunction;
55
54
  editCurrentVersion: boolean;
56
55
  editLocalizedFiles: boolean;
@@ -144,7 +143,6 @@ export type DocMetadataBase = LastUpdateData & {
144
143
  id: string; // TODO legacy versioned id => try to remove
145
144
  unversionedId: string; // TODO new unversioned id => try to rename to "id"
146
145
  version: VersionName;
147
- isDocsHomePage: boolean;
148
146
  title: string;
149
147
  description: string;
150
148
  source: string; // @site aliased source => "@site/docs/folder/subFolder/subSubFolder/myDoc.md"