mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-19 03:57:01 +02:00
chore: regenerate beta.6 examples + fix regen script (#5484)
* update examples script * rename ext * typo * update examples * fix script to update starters * update examples * add --allow-empty so that script does not fail if nothing changed * fix lint
This commit is contained in:
parent
5e74989576
commit
3de569099a
17 changed files with 1059 additions and 967 deletions
24
README.md
24
README.md
|
@ -2,32 +2,32 @@
|
||||||
|
|
||||||
This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.
|
This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.
|
||||||
|
|
||||||
## Installation
|
### Installation
|
||||||
|
|
||||||
```console
|
```
|
||||||
yarn install
|
$ yarn
|
||||||
```
|
```
|
||||||
|
|
||||||
## Local Development
|
### Local Development
|
||||||
|
|
||||||
```console
|
```
|
||||||
yarn start
|
$ yarn start
|
||||||
```
|
```
|
||||||
|
|
||||||
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
|
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
|
||||||
|
|
||||||
## Build
|
### Build
|
||||||
|
|
||||||
```console
|
```
|
||||||
yarn build
|
$ yarn build
|
||||||
```
|
```
|
||||||
|
|
||||||
This command generates static content into the `build` directory and can be served using any static contents hosting service.
|
This command generates static content into the `build` directory and can be served using any static contents hosting service.
|
||||||
|
|
||||||
## Deployment
|
### Deployment
|
||||||
|
|
||||||
```console
|
```
|
||||||
GIT_USER=<Your GitHub username> USE_SSH=true yarn deploy
|
$ GIT_USER=<Your GitHub username> USE_SSH=true yarn deploy
|
||||||
```
|
```
|
||||||
|
|
||||||
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
|
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
---
|
---
|
||||||
slug: hola
|
slug: first-blog-post
|
||||||
title: Hola
|
title: First Blog Post
|
||||||
author: Gao Wei
|
authors:
|
||||||
author_title: Docusaurus Core Team
|
name: Gao Wei
|
||||||
author_url: https://github.com/wgao19
|
title: Docusaurus Core Team
|
||||||
author_image_url: https://avatars1.githubusercontent.com/u/2055384?v=4
|
url: https://github.com/wgao19
|
||||||
|
image_url: https://github.com/wgao19.png
|
||||||
tags: [hola, docusaurus]
|
tags: [hola, docusaurus]
|
||||||
---
|
---
|
||||||
|
|
|
@ -1,17 +0,0 @@
|
||||||
---
|
|
||||||
slug: hello-world
|
|
||||||
title: Hello
|
|
||||||
author: Endilie Yacop Sucipto
|
|
||||||
author_title: Maintainer of Docusaurus
|
|
||||||
author_url: https://github.com/endiliey
|
|
||||||
author_image_url: https://avatars1.githubusercontent.com/u/17883920?s=460&v=4
|
|
||||||
tags: [hello, docusaurus]
|
|
||||||
---
|
|
||||||
|
|
||||||
Welcome to this blog. This blog is created with [**Docusaurus 2**](https://docusaurus.io/).
|
|
||||||
|
|
||||||
<!--truncate-->
|
|
||||||
|
|
||||||
This is a test post.
|
|
||||||
|
|
||||||
A whole bunch of other information.
|
|
44
blog/2019-05-29-long-blog-post.md
Normal file
44
blog/2019-05-29-long-blog-post.md
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
---
|
||||||
|
slug: long-blog-post
|
||||||
|
title: Long Blog Post
|
||||||
|
authors: endi
|
||||||
|
tags: [hello, docusaurus]
|
||||||
|
---
|
||||||
|
|
||||||
|
This is the summary of a very long blog post,
|
||||||
|
|
||||||
|
Use a `<!--` `truncate` `-->` comment to limit blog post size in the list view.
|
||||||
|
|
||||||
|
<!--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
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
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
|
|
@ -1,13 +0,0 @@
|
||||||
---
|
|
||||||
slug: welcome
|
|
||||||
title: Welcome
|
|
||||||
author: Yangshun Tay
|
|
||||||
author_title: Front End Engineer @ Facebook
|
|
||||||
author_url: https://github.com/yangshun
|
|
||||||
author_image_url: https://avatars0.githubusercontent.com/u/1315101?s=400&v=4
|
|
||||||
tags: [facebook, hello, docusaurus]
|
|
||||||
---
|
|
||||||
|
|
||||||
Blog features are powered by the blog plugin. Simply add files to the `blog` directory. It supports tags as well!
|
|
||||||
|
|
||||||
Delete the whole directory if you don't want the blog features. As simple as that!
|
|
20
blog/2021-08-01-mdx-blog-post.mdx
Normal file
20
blog/2021-08-01-mdx-blog-post.mdx
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
---
|
||||||
|
slug: mdx-blog-post
|
||||||
|
title: MDX Blog Post
|
||||||
|
authors: [slorber]
|
||||||
|
tags: [docusaurus]
|
||||||
|
---
|
||||||
|
|
||||||
|
Blog posts support [Docusaurus Markdown features](https://docusaurus.io/docs/markdown-features), such as [MDX](https://mdxjs.com/).
|
||||||
|
|
||||||
|
:::tip
|
||||||
|
|
||||||
|
Use the power of React to create interactive blog posts.
|
||||||
|
|
||||||
|
```js
|
||||||
|
<button onClick={() => alert('button clicked!')}>Click me!</button>
|
||||||
|
```
|
||||||
|
|
||||||
|
<button onClick={() => alert('button clicked!')}>Click me!</button>
|
||||||
|
|
||||||
|
:::
|
BIN
blog/2021-08-26-welcome/docusaurus-plushie-banner.jpeg
Normal file
BIN
blog/2021-08-26-welcome/docusaurus-plushie-banner.jpeg
Normal file
Binary file not shown.
After Width: | Height: | Size: 94 KiB |
25
blog/2021-08-26-welcome/index.md
Normal file
25
blog/2021-08-26-welcome/index.md
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
---
|
||||||
|
slug: welcome
|
||||||
|
title: Welcome
|
||||||
|
authors: [slorber, yangshun]
|
||||||
|
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).
|
||||||
|
|
||||||
|
Simply add Markdown files (or folders) to the `blog` directory.
|
||||||
|
|
||||||
|
Regular blog authors can be added to `authors.yml`.
|
||||||
|
|
||||||
|
The blog post date can be extracted from filenames, such as:
|
||||||
|
|
||||||
|
- `2019-05-30-welcome.md`
|
||||||
|
- `2019-05-30-welcome/index.md`
|
||||||
|
|
||||||
|
A blog post folder can be convenient to co-locate blog post images:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
The blog supports tags as well!
|
||||||
|
|
||||||
|
**And if you don't want a blog**: just delete this directory, and use `blog: false` in your Docusaurus config.
|
17
blog/authors.yml
Normal file
17
blog/authors.yml
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
endi:
|
||||||
|
name: Endilie Yacop Sucipto
|
||||||
|
title: Maintainer of Docusaurus
|
||||||
|
url: https://github.com/endiliey
|
||||||
|
image_url: https://github.com/endiliey.png
|
||||||
|
|
||||||
|
yangshun:
|
||||||
|
name: Yangshun Tay
|
||||||
|
title: Front End Engineer @ Facebook
|
||||||
|
url: https://github.com/yangshun
|
||||||
|
image_url: https://github.com/yangshun.png
|
||||||
|
|
||||||
|
slorber:
|
||||||
|
name: Sébastien Lorber
|
||||||
|
title: Docusaurus maintainer
|
||||||
|
url: https://sebastienlorber.com
|
||||||
|
image_url: https://github.com/slorber.png
|
|
@ -10,7 +10,7 @@ Let's discover **Docusaurus in less than 5 minutes**.
|
||||||
|
|
||||||
Get started by **creating a new site**.
|
Get started by **creating a new site**.
|
||||||
|
|
||||||
Or **try Docusaurus immediately** with **[new.docusaurus.io](https://new.docusaurus.io)**.
|
Or **try Docusaurus immediately** with **[docusaurus.new](https://docusaurus.new)**.
|
||||||
|
|
||||||
## Generate a new site
|
## Generate a new site
|
||||||
|
|
||||||
|
|
|
@ -14,10 +14,15 @@ Create a file at `blog/2021-02-28-greetings.md`:
|
||||||
---
|
---
|
||||||
slug: greetings
|
slug: greetings
|
||||||
title: Greetings!
|
title: Greetings!
|
||||||
author: Steven Hansel
|
authors:
|
||||||
author_title: Docusaurus Contributor
|
- name: Joel Marcey
|
||||||
author_url: https://github.com/ShinteiMai
|
title: Co-creator of Docusaurus 1
|
||||||
author_image_url: https://github.com/ShinteiMai.png
|
url: https://github.com/JoelMarcey
|
||||||
|
image_url: https://github.com/JoelMarcey.png
|
||||||
|
- name: Sébastien Lorber
|
||||||
|
title: Docusaurus maintainer
|
||||||
|
url: https://sebastienlorber.com
|
||||||
|
image_url: https://github.com/slorber.png
|
||||||
tags: [greetings]
|
tags: [greetings]
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
const lightCodeTheme = require('prism-react-renderer/themes/github');
|
const lightCodeTheme = require('prism-react-renderer/themes/github');
|
||||||
const darkCodeTheme = require('prism-react-renderer/themes/dracula');
|
const darkCodeTheme = require('prism-react-renderer/themes/dracula');
|
||||||
|
|
||||||
|
// With JSDoc @type annotations, IDEs can provide config autocompletion
|
||||||
/** @type {import('@docusaurus/types').DocusaurusConfig} */
|
/** @type {import('@docusaurus/types').DocusaurusConfig} */
|
||||||
module.exports = {
|
(module.exports = {
|
||||||
title: 'My Site',
|
title: 'My Site',
|
||||||
tagline: 'Dinosaurs are cool',
|
tagline: 'Dinosaurs are cool',
|
||||||
url: 'https://your-docusaurus-test-site.com',
|
url: 'https://your-docusaurus-test-site.com',
|
||||||
|
@ -12,82 +13,12 @@ module.exports = {
|
||||||
favicon: 'img/favicon.ico',
|
favicon: 'img/favicon.ico',
|
||||||
organizationName: 'facebook', // Usually your GitHub org/user name.
|
organizationName: 'facebook', // Usually your GitHub org/user name.
|
||||||
projectName: 'docusaurus', // Usually your repo name.
|
projectName: 'docusaurus', // Usually your repo name.
|
||||||
themeConfig: {
|
|
||||||
navbar: {
|
|
||||||
title: 'My Site',
|
|
||||||
logo: {
|
|
||||||
alt: 'My Site Logo',
|
|
||||||
src: 'img/logo.svg',
|
|
||||||
},
|
|
||||||
items: [
|
|
||||||
{
|
|
||||||
type: 'doc',
|
|
||||||
docId: 'intro',
|
|
||||||
position: 'left',
|
|
||||||
label: 'Tutorial',
|
|
||||||
},
|
|
||||||
{to: '/blog', label: 'Blog', position: 'left'},
|
|
||||||
{
|
|
||||||
href: 'https://github.com/facebook/docusaurus',
|
|
||||||
label: 'GitHub',
|
|
||||||
position: 'right',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
footer: {
|
|
||||||
style: 'dark',
|
|
||||||
links: [
|
|
||||||
{
|
|
||||||
title: 'Docs',
|
|
||||||
items: [
|
|
||||||
{
|
|
||||||
label: 'Tutorial',
|
|
||||||
to: '/docs/intro',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: 'Community',
|
|
||||||
items: [
|
|
||||||
{
|
|
||||||
label: 'Stack Overflow',
|
|
||||||
href: 'https://stackoverflow.com/questions/tagged/docusaurus',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Discord',
|
|
||||||
href: 'https://discordapp.com/invite/docusaurus',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Twitter',
|
|
||||||
href: 'https://twitter.com/docusaurus',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: 'More',
|
|
||||||
items: [
|
|
||||||
{
|
|
||||||
label: 'Blog',
|
|
||||||
to: '/blog',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'GitHub',
|
|
||||||
href: 'https://github.com/facebook/docusaurus',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
copyright: `Copyright © ${new Date().getFullYear()} My Project, Inc. Built with Docusaurus.`,
|
|
||||||
},
|
|
||||||
prism: {
|
|
||||||
theme: lightCodeTheme,
|
|
||||||
darkTheme: darkCodeTheme,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
presets: [
|
presets: [
|
||||||
[
|
[
|
||||||
'@docusaurus/preset-classic',
|
'@docusaurus/preset-classic',
|
||||||
{
|
/** @type {import('@docusaurus/preset-classic').Options} */
|
||||||
|
({
|
||||||
docs: {
|
docs: {
|
||||||
sidebarPath: require.resolve('./sidebars.js'),
|
sidebarPath: require.resolve('./sidebars.js'),
|
||||||
// Please change this to your repo.
|
// Please change this to your repo.
|
||||||
|
@ -102,7 +33,82 @@ module.exports = {
|
||||||
theme: {
|
theme: {
|
||||||
customCss: require.resolve('./src/css/custom.css'),
|
customCss: require.resolve('./src/css/custom.css'),
|
||||||
},
|
},
|
||||||
},
|
}),
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
};
|
|
||||||
|
themeConfig:
|
||||||
|
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
|
||||||
|
({
|
||||||
|
navbar: {
|
||||||
|
title: 'My Site',
|
||||||
|
logo: {
|
||||||
|
alt: 'My Site Logo',
|
||||||
|
src: 'img/logo.svg',
|
||||||
|
},
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
type: 'doc',
|
||||||
|
docId: 'intro',
|
||||||
|
position: 'left',
|
||||||
|
label: 'Tutorial',
|
||||||
|
},
|
||||||
|
{to: '/blog', label: 'Blog', position: 'left'},
|
||||||
|
{
|
||||||
|
href: 'https://github.com/facebook/docusaurus',
|
||||||
|
label: 'GitHub',
|
||||||
|
position: 'right',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
footer: {
|
||||||
|
style: 'dark',
|
||||||
|
links: [
|
||||||
|
{
|
||||||
|
title: 'Docs',
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
label: 'Tutorial',
|
||||||
|
to: '/docs/intro',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Community',
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
label: 'Stack Overflow',
|
||||||
|
href: 'https://stackoverflow.com/questions/tagged/docusaurus',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Discord',
|
||||||
|
href: 'https://discordapp.com/invite/docusaurus',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Twitter',
|
||||||
|
href: 'https://twitter.com/docusaurus',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'More',
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
label: 'Blog',
|
||||||
|
to: '/blog',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'GitHub',
|
||||||
|
href: 'https://github.com/facebook/docusaurus',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
copyright: `Copyright © ${new Date().getFullYear()} My Project, Inc. Built with Docusaurus.`,
|
||||||
|
},
|
||||||
|
prism: {
|
||||||
|
theme: lightCodeTheme,
|
||||||
|
darkTheme: darkCodeTheme,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
|
|
@ -15,8 +15,8 @@
|
||||||
"dev": "docusaurus start"
|
"dev": "docusaurus start"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@docusaurus/core": "2.0.0-beta.3",
|
"@docusaurus/core": "2.0.0-beta.6",
|
||||||
"@docusaurus/preset-classic": "2.0.0-beta.3",
|
"@docusaurus/preset-classic": "2.0.0-beta.6",
|
||||||
"@mdx-js/react": "^1.6.21",
|
"@mdx-js/react": "^1.6.21",
|
||||||
"@svgr/webpack": "^5.5.0",
|
"@svgr/webpack": "^5.5.0",
|
||||||
"clsx": "^1.1.1",
|
"clsx": "^1.1.1",
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
/* stylelint-disable docusaurus/copyright-header */
|
|
||||||
|
|
||||||
.features {
|
.features {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
/* stylelint-disable docusaurus/copyright-header */
|
|
||||||
/**
|
/**
|
||||||
* Any CSS included here will be global. The classic template
|
* Any CSS included here will be global. The classic template
|
||||||
* bundles Infima by default. Infima is a CSS framework designed to
|
* bundles Infima by default. Infima is a CSS framework designed to
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
/* stylelint-disable docusaurus/copyright-header */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CSS files with the .module.css suffix will be treated as CSS modules
|
* CSS files with the .module.css suffix will be treated as CSS modules
|
||||||
* and scoped locally.
|
* and scoped locally.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue