mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-05 04:12:53 +02:00
docs: fix highlighting of YAML front matter (#6206)
This commit is contained in:
parent
4f2330a824
commit
c8fad02029
3 changed files with 13 additions and 9 deletions
|
@ -181,7 +181,7 @@ Blog post authors can be declared directly inside the front matter:
|
||||||
<Tabs groupId="author-frontmatter">
|
<Tabs groupId="author-frontmatter">
|
||||||
<TabItem value="single" label="Single author">
|
<TabItem value="single" label="Single author">
|
||||||
|
|
||||||
```yml title="my-blog-post.md"
|
```md title="my-blog-post.md"
|
||||||
---
|
---
|
||||||
authors:
|
authors:
|
||||||
name: Joel Marcey
|
name: Joel Marcey
|
||||||
|
@ -194,7 +194,7 @@ authors:
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem value="multiple" label="Multiple authors">
|
<TabItem value="multiple" label="Multiple authors">
|
||||||
|
|
||||||
```yml title="my-blog-post.md"
|
```md title="my-blog-post.md"
|
||||||
---
|
---
|
||||||
authors:
|
authors:
|
||||||
- name: Joel Marcey
|
- name: Joel Marcey
|
||||||
|
@ -222,7 +222,7 @@ This option works best to get started, or for casual, irregular authors.
|
||||||
|
|
||||||
Prefer using the `authors` front matter, but the legacy `author_*` front matter remains supported:
|
Prefer using the `authors` front matter, but the legacy `author_*` front matter remains supported:
|
||||||
|
|
||||||
```yml title="my-blog-post.md"
|
```md title="my-blog-post.md"
|
||||||
---
|
---
|
||||||
author: Joel Marcey
|
author: Joel Marcey
|
||||||
author_title: Co-creator of Docusaurus 1
|
author_title: Co-creator of Docusaurus 1
|
||||||
|
@ -265,7 +265,7 @@ In blog posts front matter, you can reference the authors declared in the global
|
||||||
<Tabs groupId="author-frontmatter">
|
<Tabs groupId="author-frontmatter">
|
||||||
<TabItem value="single" label="Single author">
|
<TabItem value="single" label="Single author">
|
||||||
|
|
||||||
```yml title="my-blog-post.md"
|
```md title="my-blog-post.md"
|
||||||
---
|
---
|
||||||
authors: jmarcey
|
authors: jmarcey
|
||||||
---
|
---
|
||||||
|
@ -274,7 +274,7 @@ authors: jmarcey
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem value="multiple" label="Multiple authors">
|
<TabItem value="multiple" label="Multiple authors">
|
||||||
|
|
||||||
```yml title="my-blog-post.md"
|
```md title="my-blog-post.md"
|
||||||
---
|
---
|
||||||
authors: [jmarcey, slorber]
|
authors: [jmarcey, slorber]
|
||||||
---
|
---
|
||||||
|
@ -293,7 +293,7 @@ The `authors` system is very flexible and can suit more advanced use-case:
|
||||||
|
|
||||||
You can use global authors most of the time, and still use inline authors:
|
You can use global authors most of the time, and still use inline authors:
|
||||||
|
|
||||||
```yml title="my-blog-post.md"
|
```md title="my-blog-post.md"
|
||||||
---
|
---
|
||||||
authors:
|
authors:
|
||||||
- jmarcey
|
- jmarcey
|
||||||
|
@ -312,7 +312,7 @@ authors:
|
||||||
|
|
||||||
You can customize the global author's data on per-blog-post basis:
|
You can customize the global author's data on per-blog-post basis:
|
||||||
|
|
||||||
```yml title="my-blog-post.md"
|
```md title="my-blog-post.md"
|
||||||
---
|
---
|
||||||
authors:
|
authors:
|
||||||
- key: jmarcey
|
- key: jmarcey
|
||||||
|
|
|
@ -58,7 +58,7 @@ export default function page() {
|
||||||
|
|
||||||
Docusaurus automatically adds `description`, `title`, canonical URL links, and other useful metadata to each Markdown page. They are configurable through front matter:
|
Docusaurus automatically adds `description`, `title`, canonical URL links, and other useful metadata to each Markdown page. They are configurable through front matter:
|
||||||
|
|
||||||
```yml
|
```md
|
||||||
---
|
---
|
||||||
title: Title for search engines; can be different from the actual heading
|
title: Title for search engines; can be different from the actual heading
|
||||||
description: A short description of this page
|
description: A short description of this page
|
||||||
|
|
|
@ -336,7 +336,11 @@ const config = {
|
||||||
prism: {
|
prism: {
|
||||||
theme: lightTheme,
|
theme: lightTheme,
|
||||||
darkTheme,
|
darkTheme,
|
||||||
additionalLanguages: ['java'],
|
// We need to load markdown again so that YAML is loaded before MD
|
||||||
|
// and the YAML front matter is highlighted correctly.
|
||||||
|
// TODO after we have forked prism-react-renderer, we should tweak the
|
||||||
|
// import order and fix it there
|
||||||
|
additionalLanguages: ['java', 'markdown'],
|
||||||
},
|
},
|
||||||
image: 'img/docusaurus-soc.png',
|
image: 'img/docusaurus-soc.png',
|
||||||
// metadata: [{name: 'twitter:card', content: 'summary'}],
|
// metadata: [{name: 'twitter:card', content: 'summary'}],
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue