{useLocation().pathname};
-
-export const FilePath = () => {
- const currentVersion = useActiveDocContext('default').activeVersion.name;
- return {currentVersion === 'current' ? './docs/' : `./versioned_docs/version-${currentVersion}/`}advanced/routing.md;
-}
-```
-
-This page, The title of this page is: {contentTitle}
-``` - -```mdx-code-block -import TOCInline from '@theme/TOCInline'; - -The title of this page is: {contentTitle}
- -
` served at `https://example.com/test`, the browser will try to resolve it from the URL root, i.e. as `https://example.com/img/docusaurus.png`, which will fail because it's actually served at `https://example.com/test/img/docusaurus.png`.
-
-You can `import` / `require()` the static asset (recommended), or use the `useBaseUrl` utility function: both prepend the `baseUrl` to paths for you.
-
-:::info
-
-In Markdown, things are different: you can stick to use absolute paths because Docusaurus actually handles them as `require` calls instead of URLs when parsing the Markdown. See [Markdown static assets](./guides/markdown-features/markdown-features-assets.mdx).
-
-:::
-
-### Examples {#examples}
-
-```jsx title="MyComponent.js"
-import DocusaurusImageUrl from '@site/static/img/docusaurus.png';
-
-
-```
-
-```jsx title="MyComponent.js"
-import useBaseUrl from '@docusaurus/useBaseUrl';
-
-
;
-```
-
-You can also import SVG files: they will be transformed into React components.
-
-```jsx title="MyComponent.js"
-import DocusaurusLogoWithKeytar from '@site/static/img/docusaurus_keytar.svg';
-
-{useLocation().pathname};
+
+export const FilePath = () => {
+ const currentVersion = useActiveDocContext('default').activeVersion.name;
+ return {currentVersion === 'current' ? './docs/' : `./versioned_docs/version-${currentVersion}/`}advanced/routing.md;
+}
+```
+
+The individual docs are rendered in the remaining space after the navbar, footer, sidebar, etc. have all been provided by the `DocPage` component. For example, this page, {location.pathname}
+
+ );
+}
+```
+
+```mdx-code-block
+export function PageRoute() {
+ const location = useLocation();
+ return (
+
+ We are currently on {location.pathname}
+
+ );
+}
+
+process.env.NODE_ENV?string \| null | `'/archive'` | URL route for the archive blog section of your site. It is prepended to the `routeBasePath`. **DO NOT** include a trailing slash. Use `null` to disable generation of archive. |
| `include` | `string[]` | `['**/*.{md,mdx}']` | Matching files will be included and processed. |
| `exclude` | `string[]` | _See example configuration_ | No route will be created for matching files. |
| `postsPerPage` | number \| 'ALL' | `10` | Number of posts to show per page in the listing page. Use `'ALL'` to display all posts on one listing page. |
@@ -48,6 +54,7 @@ Accepted fields:
| `blogPostComponent` | `string` | `'@theme/BlogPostPage'` | Root component of each blog post page. |
| `blogTagsListComponent` | `string` | `'@theme/BlogTagsListPage'` | Root component of the tags list page |
| `blogTagsPostsComponent` | `string` | `'@theme/BlogTagsPostsPage'` | Root component of the "posts containing tag" page. |
+| `blogArchiveComponent` | `string` | `'@theme/BlogArchivePage'` | Root component of the blog archive page. |
| `remarkPlugins` | `any[]` | `[]` | Remark plugins passed to MDX. |
| `rehypePlugins` | `any[]` | `[]` | Rehype plugins passed to MDX. |
| `beforeDefaultRemarkPlugins` | `any[]` | `[]` | Custom Remark plugins passed to MDX before the default Docusaurus Remark plugins. |
@@ -66,7 +73,7 @@ Accepted fields:
-```typescript
+```ts
type EditUrlFunction = (params: {
blogDirPath: string;
blogPath: string;
@@ -94,27 +101,27 @@ type ReadingTimeFunctionOption = (params: {
type FeedType = 'rss' | 'atom' | 'json';
```
-## Example configuration {#ex-config}
+### Example configuration {#ex-config}
-Here's an example configuration object.
-
-You can provide it as [preset options](#ex-config-preset) or [plugin options](#ex-config-plugin).
+You can configure this plugin through preset options or plugin options.
:::tip
-Most Docusaurus users configure this plugin through the [preset options](#ex-config-preset).
+Most Docusaurus users configure this plugin through the preset options.
:::
-```js
+```js config-tabs
+// Preset Options: blog
+// Plugin Options: @docusaurus/plugin-content-blog
+
const config = {
path: 'blog',
// Simple use-case: string editUrl
// editUrl: 'https://github.com/facebook/docusaurus/edit/main/website/',
// Advanced use-case: functional editUrl
- editUrl: ({locale, blogDirPath, blogPath, permalink}) => {
- return `https://github.com/facebook/docusaurus/edit/main/website/${blogDirPath}/${blogPath}`;
- },
+ editUrl: ({locale, blogDirPath, blogPath, permalink}) =>
+ `https://github.com/facebook/docusaurus/edit/main/website/${blogDirPath}/${blogPath}`,
editLocalizedFiles: false,
blogTitle: 'Blog title',
blogDescription: 'Blog',
@@ -149,51 +156,9 @@ const config = {
};
```
-### Preset options {#ex-config-preset}
+## Markdown front matter {#markdown-front-matter}
-If you use a preset, configure this plugin through the [preset options](presets.md#docusauruspreset-classic):
-
-```js title="docusaurus.config.js"
-module.exports = {
- presets: [
- [
- '@docusaurus/preset-classic',
- {
- // highlight-start
- blog: {
- path: 'blog',
- // ... configuration object here
- },
- // highlight-end
- },
- ],
- ],
-};
-```
-
-### Plugin options {#ex-config-plugin}
-
-If you are using a standalone plugin, provide options directly to the plugin:
-
-```js title="docusaurus.config.js"
-module.exports = {
- plugins: [
- [
- '@docusaurus/plugin-content-blog',
- // highlight-start
- {
- path: 'blog',
- // ... configuration object here
- },
- // highlight-end
- ],
- ],
-};
-```
-
-## Markdown Frontmatter {#markdown-frontmatter}
-
-Markdown documents can use the following Markdown FrontMatter metadata fields, enclosed by a line `---` on either side.
+Markdown documents can use the following Markdown front matter metadata fields, enclosed by a line `---` on either side.
Accepted fields:
@@ -201,7 +166,7 @@ Accepted fields:
| Name | Type | Default | Description |
| --- | --- | --- | --- |
-| `authors` | `Authors` | `undefined` | List of blog post authors (or unique author). Read the [`authors` guide](../../blog.mdx#blog-post-authors) for more explanations. Prefer `authors` over the `author_*` FrontMatter fields, even for single author blog posts. |
+| `authors` | `Authors` | `undefined` | List of blog post authors (or unique author). Read the [`authors` guide](../../blog.mdx#blog-post-authors) for more explanations. Prefer `authors` over the `author_*` front matter fields, even for single author blog posts. |
| `author` | `string` | `undefined` | β οΈ Prefer using `authors`. The blog post author's name. |
| `author_url` | `string` | `undefined` | β οΈ Prefer using `authors`. The URL that the author's name will be linked to. This could be a GitHub, Twitter, Facebook profile URL, etc. |
| `author_image_url` | `string` | `undefined` | β οΈ Prefer using `authors`. The URL to the author's thumbnail image. |
@@ -220,7 +185,7 @@ Accepted fields:
-```typescript
+```ts
type Tag = string | {label: string; permalink: string};
// An author key references an author from the global plugin authors.yml file
@@ -234,13 +199,13 @@ type Author = {
image_url?: string;
};
-// The FrontMatter authors field allows various possible shapes
+// The front matter authors field allows various possible shapes
type Authors = AuthorKey | Author | (AuthorKey | Author)[];
```
Example:
-```yml
+```md
---
title: Welcome Docusaurus v2
authors:
@@ -255,6 +220,7 @@ description: This is my first post on Docusaurus 2.
image: https://i.imgur.com/mErPwqL.png
hide_table_of_contents: false
---
+
A Markdown blog post
```
diff --git a/website/versioned_docs/version-2.0.0-beta.14/api/plugins/plugin-content-docs.md b/website/versioned_docs/version-2.0.0-beta.16/api/plugins/plugin-content-docs.md
similarity index 82%
rename from website/versioned_docs/version-2.0.0-beta.14/api/plugins/plugin-content-docs.md
rename to website/versioned_docs/version-2.0.0-beta.16/api/plugins/plugin-content-docs.md
index 47c241b821..2c97cd4ab7 100644
--- a/website/versioned_docs/version-2.0.0-beta.14/api/plugins/plugin-content-docs.md
+++ b/website/versioned_docs/version-2.0.0-beta.16/api/plugins/plugin-content-docs.md
@@ -19,7 +19,7 @@ npm install --save @docusaurus/plugin-content-docs
If you use the preset `@docusaurus/preset-classic`, you don't need to install this plugin as a dependency.
-You can configure this plugin through the [preset options](#ex-config-preset).
+You can configure this plugin through the preset options.
:::
@@ -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. |
@@ -55,15 +56,15 @@ Accepted fields:
| `beforeDefaultRehypePlugins` | `any[]` | `[]` | Custom Rehype plugins passed to MDX before the default Docusaurus Rehype plugins. |
| `showLastUpdateAuthor` | `boolean` | `false` | Whether to display the author who last updated the doc. |
| `showLastUpdateTime` | `boolean` | `false` | Whether to display the last date the doc was updated. |
-| `disableVersioning` | `boolean` | `false` | Explicitly disable the versioning feature even with versions. This will only include the "current" version (the `/docs` directory). |
-| `includeCurrentVersion` | `boolean` | `true` | Include the "current" version of your docs (the `/docs` directory). 'left' \| 'right' | `'left'` | The side of the navbar this item should appear on. |
+| `docsPluginId` | `string` | `'default'` | The ID of the docs plugin that the sidebar belongs to. |
+
++ {/* highlight-next-line */} Check out my blog!
+ {/* highlight-next-line */} Follow me on Twitter!
+
', // The HTML to be rendered
+ defaultStyle: true, // Use the default menu item styling
+ },
+ // highlight-end
+ ],
+};
+```
+
+:::tip
+
+The menu item is already wrapped in an `./docs folder./docs.Use plugins to introduce shorter syntax for the most commonly used JSX elements in your project.
-+ Use plugins to introduce shorter syntax for the most commonly used JSX + elements in your project. +
+
+
`, without any processing or file existence checking.
diff --git a/website/versioned_docs/version-2.0.0-beta.14/guides/markdown-features/markdown-features-code-blocks.mdx b/website/versioned_docs/version-2.0.0-beta.16/guides/markdown-features/markdown-features-code-blocks.mdx
similarity index 67%
rename from website/versioned_docs/version-2.0.0-beta.14/guides/markdown-features/markdown-features-code-blocks.mdx
rename to website/versioned_docs/version-2.0.0-beta.16/guides/markdown-features/markdown-features-code-blocks.mdx
index 5c355f1e46..7934b6ebaa 100644
--- a/website/versioned_docs/version-2.0.0-beta.14/guides/markdown-features/markdown-features-code-blocks.mdx
+++ b/website/versioned_docs/version-2.0.0-beta.16/guides/markdown-features/markdown-features-code-blocks.mdx
@@ -5,11 +5,14 @@ description: Handling code blocks in Docusaurus Markdown
slug: /markdown-features/code-blocks
---
+import BrowserWindow from '@site/src/components/BrowserWindow';
+import CodeBlock from '@theme/CodeBlock';
+
Code blocks within documentation are super-powered πͺ.
## Code title {#code-title}
-You can add a title to the code block by adding `title` key after the language (leave a space between them).
+You can add a title to the code block by adding a `title` key after the language (leave a space between them).
```jsx title="/src/components/HelloCodeTitle.js"
function HelloCodeTitle(props) {
@@ -17,44 +20,53 @@ You can add a title to the code block by adding `title` key after the language (
}
```
+remark-math and rehype-katex different?The title of this page is: {contentTitle}
+``` + +```mdx-code-block +import TOCInline from '@theme/TOCInline'; + +The title of this page is: {contentTitle}
+ +
+
+ Some component implementation details
+