mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-14 09:37:37 +02:00
fix(create-docusaurus): Improve init templates blog setup + fix warnings (#10392)
This commit is contained in:
parent
471f0d4333
commit
547979a59f
10 changed files with 35 additions and 17 deletions
|
@ -50,6 +50,10 @@ const config: Config = {
|
||||||
// Remove this to remove the "edit this page" links.
|
// Remove this to remove the "edit this page" links.
|
||||||
editUrl:
|
editUrl:
|
||||||
'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
|
'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
|
||||||
|
// Useful options to enforce blogging best practices
|
||||||
|
onInlineTags: 'warn',
|
||||||
|
onInlineAuthors: 'warn',
|
||||||
|
onUntruncatedBlogPosts: 'warn',
|
||||||
},
|
},
|
||||||
theme: {
|
theme: {
|
||||||
customCss: './src/css/custom.css',
|
customCss: './src/css/custom.css',
|
||||||
|
|
|
@ -56,6 +56,10 @@ const config = {
|
||||||
// Remove this to remove the "edit this page" links.
|
// Remove this to remove the "edit this page" links.
|
||||||
editUrl:
|
editUrl:
|
||||||
'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
|
'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
|
||||||
|
// Useful options to enforce blogging best practices
|
||||||
|
onInlineTags: 'warn',
|
||||||
|
onInlineAuthors: 'warn',
|
||||||
|
onUntruncatedBlogPosts: 'warn',
|
||||||
},
|
},
|
||||||
theme: {
|
theme: {
|
||||||
customCss: './src/css/custom.css',
|
customCss: './src/css/custom.css',
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
---
|
---
|
||||||
slug: first-blog-post
|
slug: first-blog-post
|
||||||
title: First Blog Post
|
title: First Blog Post
|
||||||
authors:
|
authors: [slorber, yangshun]
|
||||||
name: Gao Wei
|
|
||||||
title: Docusaurus Core Team
|
|
||||||
url: https://github.com/wgao19
|
|
||||||
image_url: https://github.com/wgao19.png
|
|
||||||
tags: [hola, docusaurus]
|
tags: [hola, docusaurus]
|
||||||
---
|
---
|
||||||
|
|
||||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
|
Lorem ipsum dolor sit amet...
|
||||||
|
|
||||||
|
<!-- truncate -->
|
||||||
|
|
||||||
|
...consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
slug: long-blog-post
|
slug: long-blog-post
|
||||||
title: Long Blog Post
|
title: Long Blog Post
|
||||||
authors: endi
|
authors: yangshun
|
||||||
tags: [hello, docusaurus]
|
tags: [hello, docusaurus]
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ This is the summary of a very long blog post,
|
||||||
|
|
||||||
Use a `<!--` `truncate` `-->` comment to limit blog post size in the list view.
|
Use a `<!--` `truncate` `-->` comment to limit blog post size in the list view.
|
||||||
|
|
||||||
<!--truncate-->
|
<!-- truncate -->
|
||||||
|
|
||||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
|
||||||
|
|
||||||
|
|
|
@ -11,10 +11,14 @@ Blog posts support [Docusaurus Markdown features](https://docusaurus.io/docs/mar
|
||||||
|
|
||||||
Use the power of React to create interactive blog posts.
|
Use the power of React to create interactive blog posts.
|
||||||
|
|
||||||
|
:::
|
||||||
|
|
||||||
|
{/* truncate */}
|
||||||
|
|
||||||
|
For example, use JSX to create an interactive button:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
<button onClick={() => alert('button clicked!')}>Click me!</button>
|
<button onClick={() => alert('button clicked!')}>Click me!</button>
|
||||||
```
|
```
|
||||||
|
|
||||||
<button onClick={() => alert('button clicked!')}>Click me!</button>
|
<button onClick={() => alert('button clicked!')}>Click me!</button>
|
||||||
|
|
||||||
:::
|
|
||||||
|
|
|
@ -7,6 +7,10 @@ tags: [facebook, hello, docusaurus]
|
||||||
|
|
||||||
[Docusaurus blogging features](https://docusaurus.io/docs/blog) are powered by the [blog plugin](https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-content-blog).
|
[Docusaurus blogging features](https://docusaurus.io/docs/blog) are powered by the [blog plugin](https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-content-blog).
|
||||||
|
|
||||||
|
Here are a few tips you might find useful.
|
||||||
|
|
||||||
|
<!-- truncate -->
|
||||||
|
|
||||||
Simply add Markdown files (or folders) to the `blog` directory.
|
Simply add Markdown files (or folders) to the `blog` directory.
|
||||||
|
|
||||||
Regular blog authors can be added to `authors.yml`.
|
Regular blog authors can be added to `authors.yml`.
|
||||||
|
|
|
@ -1,14 +1,9 @@
|
||||||
endi:
|
|
||||||
name: Endilie Yacop Sucipto
|
|
||||||
title: Maintainer of Docusaurus
|
|
||||||
url: https://github.com/endiliey
|
|
||||||
image_url: https://github.com/endiliey.png
|
|
||||||
|
|
||||||
yangshun:
|
yangshun:
|
||||||
name: Yangshun Tay
|
name: Yangshun Tay
|
||||||
title: Front End Engineer @ Facebook
|
title: Front End Engineer @ Facebook
|
||||||
url: https://github.com/yangshun
|
url: https://github.com/yangshun
|
||||||
image_url: https://github.com/yangshun.png
|
image_url: https://github.com/yangshun.png
|
||||||
|
page: true
|
||||||
socials:
|
socials:
|
||||||
x: yangshunz
|
x: yangshunz
|
||||||
github: yangshun
|
github: yangshun
|
||||||
|
@ -18,6 +13,9 @@ slorber:
|
||||||
title: Docusaurus maintainer
|
title: Docusaurus maintainer
|
||||||
url: https://sebastienlorber.com
|
url: https://sebastienlorber.com
|
||||||
image_url: https://github.com/slorber.png
|
image_url: https://github.com/slorber.png
|
||||||
|
page:
|
||||||
|
# customize the url of the author page at /blog/authors/<permalink>
|
||||||
|
permalink: '/all-sebastien-lorber-articles'
|
||||||
socials:
|
socials:
|
||||||
x: sebastienlorber
|
x: sebastienlorber
|
||||||
linkedin: sebastienlorber
|
linkedin: sebastienlorber
|
||||||
|
|
|
@ -2,14 +2,17 @@ facebook:
|
||||||
label: Facebook
|
label: Facebook
|
||||||
permalink: /facebook
|
permalink: /facebook
|
||||||
description: Facebook tag description
|
description: Facebook tag description
|
||||||
|
|
||||||
hello:
|
hello:
|
||||||
label: Hello
|
label: Hello
|
||||||
permalink: /hello
|
permalink: /hello
|
||||||
description: Hello tag description
|
description: Hello tag description
|
||||||
|
|
||||||
docusaurus:
|
docusaurus:
|
||||||
label: Docusaurus
|
label: Docusaurus
|
||||||
permalink: /docusaurus
|
permalink: /docusaurus
|
||||||
description: Docusaurus tag description
|
description: Docusaurus tag description
|
||||||
|
|
||||||
hola:
|
hola:
|
||||||
label: Hola
|
label: Hola
|
||||||
permalink: /hola
|
permalink: /hola
|
||||||
|
|
|
@ -68,9 +68,9 @@ export const DEFAULT_OPTIONS: PluginOptions = {
|
||||||
showLastUpdateTime: false,
|
showLastUpdateTime: false,
|
||||||
showLastUpdateAuthor: false,
|
showLastUpdateAuthor: false,
|
||||||
processBlogPosts: async () => undefined,
|
processBlogPosts: async () => undefined,
|
||||||
onInlineTags: 'warn',
|
|
||||||
tags: undefined,
|
tags: undefined,
|
||||||
authorsBasePath: 'authors',
|
authorsBasePath: 'authors',
|
||||||
|
onInlineTags: 'warn',
|
||||||
onInlineAuthors: 'warn',
|
onInlineAuthors: 'warn',
|
||||||
onUntruncatedBlogPosts: 'warn',
|
onUntruncatedBlogPosts: 'warn',
|
||||||
};
|
};
|
||||||
|
|
|
@ -168,6 +168,7 @@ linkify
|
||||||
Linkify
|
Linkify
|
||||||
Localizable
|
Localizable
|
||||||
lockb
|
lockb
|
||||||
|
lorber
|
||||||
Lorber
|
Lorber
|
||||||
Lorber's
|
Lorber's
|
||||||
lqip
|
lqip
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue