From df6ef4c432bff38479cc0840617c374173f50e1a Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Wed, 16 Feb 2022 18:46:47 +0100 Subject: [PATCH] move/refactor doc --- .../docs/api/plugins/plugin-content-docs.md | 2 ++ .../docs/api/themes/theme-configuration.md | 25 ------------------- website/docs/guides/docs/sidebar/index.md | 22 ++++++++++++++++ 3 files changed, 24 insertions(+), 25 deletions(-) diff --git a/website/docs/api/plugins/plugin-content-docs.md b/website/docs/api/plugins/plugin-content-docs.md index 0c52f97ad252..2c97cd4ab78e 100644 --- a/website/docs/api/plugins/plugin-content-docs.md +++ b/website/docs/api/plugins/plugin-content-docs.md @@ -32,6 +32,7 @@ Accepted fields: | Name | Type | Default | Description | | --- | --- | --- | --- | | `path` | `string` | `'docs'` | Path to data on filesystem relative to site dir. | +| `breadcrumbs` | `boolean` | `true` | To enable or disable the breadcrumbs on docs pages. | | `editUrl` | string \| EditUrlFunction | `undefined` | Base URL to edit your site. The final URL is computed by `editUrl + relativeDocPath`. Using a function allows more nuanced control for each file. Omitting this variable entirely will disable edit links. | | `editLocalizedFiles` | `boolean` | `false` | The edit URL will target the localized file, instead of the original unlocalized file. Ignored when `editUrl` is a function. | | `editCurrentVersion` | `boolean` | `false` | The edit URL will always target the current version doc instead of older versions. Ignored when `editUrl` is a function. | @@ -127,6 +128,7 @@ Most Docusaurus users configure this plugin through the preset options. const config = { path: 'docs', + breadcrumbs: true, // Simple use-case: string editUrl // editUrl: 'https://github.com/facebook/docusaurus/edit/main/website/', // Advanced use-case: functional editUrl diff --git a/website/docs/api/themes/theme-configuration.md b/website/docs/api/themes/theme-configuration.md index aa3a1e0a22ec..e79cf89614cf 100644 --- a/website/docs/api/themes/theme-configuration.md +++ b/website/docs/api/themes/theme-configuration.md @@ -159,31 +159,6 @@ module.exports = { }; ``` -### Breadcrumbs {#breadcrumbs} - -Breadcrumbs can be rendered on each document page, based on sidebar items. - -Accepted fields: - - - -| Name | Type | Default | Description | -| --- | --- | --- | --- | -| `breadcrumbs` | boolean \| 'nested' | `nested` | Use boolean value to strictly enable or disable all breadcrumbs, or use `'nested'` when you only want breadcrumbs visible in nested pages. | - - - -Example configuration: - -```js title="docusaurus.config.js" -module.exports = { - themeConfig: { - // highlight-next-line - breadcrumbs: 'nested', - }, -}; -``` - ## Navbar {#navbar} Accepted fields: diff --git a/website/docs/guides/docs/sidebar/index.md b/website/docs/guides/docs/sidebar/index.md index d78b0367d213..9634f4853cac 100644 --- a/website/docs/guides/docs/sidebar/index.md +++ b/website/docs/guides/docs/sidebar/index.md @@ -160,6 +160,28 @@ To pass in custom props to a swizzled sidebar item, add the optional `customProp }; ``` +## Sidebar Breadcrumbs {#sidebar-breadcrumbs} + +By default, breadcrumbs are rendered at the top, using the "sidebar path" of the current page. + +This behavior can be disabled with plugin options: + +```js title="docusaurus.config.js" +module.exports = { + presets: [ + [ + '@docusaurus/preset-classic', + { + docs: { + // highlight-next-line + breadcrumbs: false, + }, + }, + ], + ], +}; +``` + ## Complex sidebars example {#complex-sidebars-example} A real-world example from the Docusaurus site: