mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-05 12:22:45 +02:00
Merge branch 'master' into feature/client-side-redirects
This commit is contained in:
commit
03f4100cd4
55 changed files with 479 additions and 274 deletions
|
@ -3,7 +3,7 @@ id: contributing
|
|||
title: Contributing
|
||||
---
|
||||
|
||||
[Docusaurus 2](https://v2.docusaurus.io) is currently under alpha development. We have [early adopters who already started using it](/showcase). We are now welcoming contributors to collaborate on the next Docusaurus.
|
||||
[Docusaurus 2](https://v2.docusaurus.io/) is currently under alpha development. We have [early adopters who already started using it](/showcase). We are now welcoming contributors to collaborate on the next Docusaurus.
|
||||
|
||||
The [Open Source Guides](https://opensource.guide/) website has a collection of resources for individuals, communities, and companies who want to learn how to run and contribute to an open source project. Contributors and people new to open source alike will find the following guides especially useful:
|
||||
|
||||
|
@ -48,7 +48,7 @@ We use [GitHub Issues](https://github.com/facebook/docusaurus/issues) for our pu
|
|||
|
||||
If you have questions about using Docusaurus, contact the Docusaurus Twitter account at [@docusaurus](https://twitter.com/docusaurus), and we will do our best to answer your questions.
|
||||
|
||||
You can also file issues as [feature requests or enhancements](https://github.com/facebook/docusaurus/labels/feature). If you see anything you'd like to be implemented, create an issue with [feature template](https://raw.githubusercontent.com/facebook/docusaurus/master/.github/ISSUE_TEMPLATE/feature.md)
|
||||
You can also file issues as [feature requests or enhancements](https://github.com/facebook/docusaurus/labels/feature). If you see anything you'd like to be implemented, create an issue with [feature template](https://raw.githubusercontent.com/facebook/docusaurus/master/.github/ISSUE_TEMPLATE/feature.md/)
|
||||
|
||||
### Reporting security bugs
|
||||
|
||||
|
@ -97,7 +97,7 @@ Use lower case not title case!
|
|||
|
||||
#### Style guide
|
||||
|
||||
[Prettier](https://prettier.io) will catch most styling issues that may exist in your code. You can check the status of your code styling by simply running `npm run prettier`.
|
||||
[Prettier](https://prettier.io/) will catch most styling issues that may exist in your code. You can check the status of your code styling by simply running `npm run prettier`.
|
||||
|
||||
However, there are still some styles that Prettier cannot pick up.
|
||||
|
||||
|
@ -124,7 +124,7 @@ We have a list of [beginner friendly issues](https://github.com/facebook/docusau
|
|||
|
||||
### Proposing a change
|
||||
|
||||
If you would like to request a new feature or enhancement but are not yet thinking about opening a pull request, you can also file an issue with [feature template](https://github.com/facebook/docusaurus/issues/new?template=feature.md).
|
||||
If you would like to request a new feature or enhancement but are not yet thinking about opening a pull request, you can also file an issue with [feature template](https://github.com/facebook/docusaurus/issues/new?template=feature.md/).
|
||||
|
||||
If you intend to change the public API (e.g., something in `docusaurus.config.js`), or make any non-trivial changes to the implementation, we recommend filing an issue with [proposal template](https://github.com/facebook/docusaurus/issues/new?template=proposal.md) and including `[Proposal]` in the title. This lets us reach an agreement on your proposal before you put significant effort into it. These types of issues should be rare.
|
||||
|
||||
|
@ -138,7 +138,7 @@ Please make sure the following is done when submitting a pull request:
|
|||
|
||||
1. Fork [the repository](https://github.com/facebook/docusaurus) and create your branch from `master`.
|
||||
1. Add the copyright notice to the top of any code new files you've added.
|
||||
1. Describe your [test plan](#test-plan) in your pull request description. Make sure to [test your changes](https://github.com/facebook/docusaurus/blob/master/admin/testing-changes-on-Docusaurus-itself.md)!
|
||||
1. Describe your [test plan](#test-plan) in your pull request description. Make sure to [test your changes](https://github.com/facebook/docusaurus/blob/master/admin/testing-changes-on-Docusaurus-itself.md/)!
|
||||
1. Make sure your code lints (`yarn prettier && yarn lint`).
|
||||
1. Make sure your Jest tests pass (`yarn test`).
|
||||
1. If you haven't already, [sign the CLA](https://code.facebook.com/cla).
|
||||
|
|
|
@ -73,7 +73,7 @@ const Page = () => (
|
|||
Check out my <Link to="/blog">blog</Link>!
|
||||
</p>
|
||||
<p>
|
||||
{/* Note that external links still use `a` tags. */}
|
||||
{/* Note that external links still use `a` tags, but automatically opens in new tab. */}
|
||||
Follow me on <a href="https://twitter.com/docusaurus">Twitter</a>!
|
||||
</p>
|
||||
</div>
|
||||
|
|
|
@ -140,7 +140,7 @@ One benefit of this approach is that the links to external files will still work
|
|||
|
||||
## Embedding React components with MDX
|
||||
|
||||
Docusaurus has built-in support for [MDX](https://mdxjs.com), which allows you to write JSX within your Markdown files and render them as React components.
|
||||
Docusaurus has built-in support for [MDX](https://mdxjs.com/), which allows you to write JSX within your Markdown files and render them as React components.
|
||||
|
||||
**Note 1:** While both `.md` and `.mdx` files are parsed using MDX, some of the syntax are treated slightly differently. For the most accurate parsing and better editor support, we recommend using the `.mdx` extension for files containing MDX syntax. Let's rename the previous file to `greeting.mdx`.
|
||||
|
||||
|
|
|
@ -456,8 +456,8 @@ Please refer to [creating pages](creating-pages.md) to learn how Docusaurus 2 pa
|
|||
|
||||
The following code could be helpful for migration of various pages:
|
||||
|
||||
- Index page - [Flux](https://github.com/facebook/flux/blob/master/website/src/pages/index.js) (recommended), [Docusaurus 2](https://github.com/facebook/docusaurus/blob/master/website/src/pages/index.js), [Hermes](https://github.com/facebook/hermes/blob/master/website/src/pages/index.js)
|
||||
- Help/Support page - [Docusaurus 2](https://github.com/facebook/docusaurus/blob/master/website/src/pages/help.js), [Flux](http://facebook.github.io/flux/support)
|
||||
- Index page - [Flux](https://github.com/facebook/flux/blob/master/website/src/pages/index.js/) (recommended), [Docusaurus 2](https://github.com/facebook/docusaurus/blob/master/website/src/pages/index.js/), [Hermes](https://github.com/facebook/hermes/blob/master/website/src/pages/index.js/)
|
||||
- Help/Support page - [Docusaurus 2](https://github.com/facebook/docusaurus/blob/master/website/src/pages/help.js/), [Flux](http://facebook.github.io/flux/support)
|
||||
|
||||
## Content
|
||||
|
||||
|
|
|
@ -40,8 +40,11 @@ Presets in some way are a shorthand function to add plugins and themes to your d
|
|||
```js
|
||||
module.exports = function preset(context, opts = {}) {
|
||||
return {
|
||||
themes: ['@docusaurus/themes-cool', '@docusaurus/themes-bootstrap'],
|
||||
plugins: ['@docusaurus/plugin-blog'],
|
||||
themes: [
|
||||
require.resolve('@docusaurus/themes-cool'),
|
||||
require.resolve('@docusaurus/themes-bootstrap'),
|
||||
],
|
||||
plugins: [require.resolve('@docusaurus/plugin-blog')],
|
||||
};
|
||||
};
|
||||
```
|
||||
|
|
|
@ -9,6 +9,10 @@ A curated list of interesting Docusaurus community projects.
|
|||
|
||||
- [F8 2019: Using Docusaurus to Create Open Source Websites](https://www.youtube.com/watch?v=QcGJsf6mgZE)
|
||||
|
||||
## Articles
|
||||
|
||||
- [Live code editing in Docusaurus](https://dev.to/mrmuhammadali/live-code-editing-in-docusaurus-28k)
|
||||
|
||||
## Showcase
|
||||
|
||||
See the <a href={require('@docusaurus/useBaseUrl').default('showcase')}>showcase</a>.
|
||||
|
|
|
@ -145,36 +145,42 @@ module.exports = {
|
|||
'@docusaurus/plugin-content-blog',
|
||||
{
|
||||
/**
|
||||
* Path to data on filesystem
|
||||
* relative to site dir
|
||||
* Path to data on filesystem relative to site dir.
|
||||
*/
|
||||
path: 'blog',
|
||||
/**
|
||||
* URL for editing a blog post, example: 'https://github.com/facebook/docusaurus/edit/master/website/blog/'
|
||||
* URL for editing a blog post.
|
||||
* Example: 'https://github.com/facebook/docusaurus/edit/master/website/blog/'
|
||||
*/
|
||||
editUrl:
|
||||
'https://github.com/facebook/docusaurus/edit/master/website/blog/',
|
||||
/**
|
||||
* URL route for the blog section of your site
|
||||
* do not include trailing slash
|
||||
* URL route for the blog section of your site.
|
||||
* *DO NOT* include a trailing slash.
|
||||
*/
|
||||
routeBasePath: 'blog',
|
||||
include: ['*.md', '*.mdx'],
|
||||
postsPerPage: 10,
|
||||
/**
|
||||
* Theme components used by the blog pages
|
||||
* Theme components used by the blog pages.
|
||||
*/
|
||||
blogListComponent: '@theme/BlogListPage',
|
||||
blogPostComponent: '@theme/BlogPostPage',
|
||||
blogTagsListComponent: '@theme/BlogTagsListPage',
|
||||
blogTagsPostsComponent: '@theme/BlogTagsPostsPage',
|
||||
/**
|
||||
* Remark and Rehype plugins passed to MDX
|
||||
* Remark and Rehype plugins passed to MDX.
|
||||
*/
|
||||
remarkPlugins: [
|
||||
/* require('remark-math') */
|
||||
],
|
||||
rehypePlugins: [],
|
||||
/**
|
||||
* Custom Remark and Rehype plugins passed to MDX before
|
||||
* the default Docusaurus Remark and Rehype plugins.
|
||||
*/
|
||||
beforeDefaultRemarkPlugins: [],
|
||||
beforeDefaultRehypePlugins: [],
|
||||
/**
|
||||
* Truncate marker, can be a regex or string.
|
||||
*/
|
||||
|
@ -184,8 +190,8 @@ module.exports = {
|
|||
*/
|
||||
showReadingTime: true,
|
||||
/**
|
||||
* Blog feed
|
||||
* If feedOptions is undefined, no rss feed will be generated
|
||||
* Blog feed.
|
||||
* If feedOptions is undefined, no rss feed will be generated.
|
||||
*/
|
||||
feedOptions: {
|
||||
type: '', // required. 'rss' | 'feed' | 'all'
|
||||
|
@ -223,17 +229,17 @@ module.exports = {
|
|||
'@docusaurus/plugin-content-docs',
|
||||
{
|
||||
/**
|
||||
* Path to data on filesystem
|
||||
* relative to site dir
|
||||
* Path to data on filesystem relative to site dir.
|
||||
*/
|
||||
path: 'docs',
|
||||
/**
|
||||
* URL for editing website repo, example: 'https://github.com/facebook/docusaurus/edit/master/website/'
|
||||
* URL for editing a doc in the website repo.
|
||||
* Example: 'https://github.com/facebook/docusaurus/edit/master/website/'
|
||||
*/
|
||||
editUrl: 'https://github.com/facebook/docusaurus/edit/master/website/',
|
||||
/**
|
||||
* URL route for the blog section of your site
|
||||
* do not include trailing slash
|
||||
* URL route for the blog section of your site.
|
||||
* *DO NOT* include a trailing slash.
|
||||
*/
|
||||
routeBasePath: 'docs',
|
||||
homePageId: '_index', // Document id for docs home page.
|
||||
|
@ -255,6 +261,12 @@ module.exports = {
|
|||
/* require('remark-math') */
|
||||
],
|
||||
rehypePlugins: [],
|
||||
/**
|
||||
* Custom Remark and Rehype plugins passed to MDX before
|
||||
* the default Docusaurus Remark and Rehype plugins.
|
||||
*/
|
||||
beforeDefaultRemarkPlugins: [],
|
||||
beforeDefaultRehypePlugins: [],
|
||||
/**
|
||||
* Whether to display the author who last updated the doc.
|
||||
*/
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@docusaurus/core": "^2.0.0-alpha.55",
|
||||
"@docusaurus/theme-live-codeblock": "^2.0.0-alpha.55",
|
||||
"@docusaurus/plugin-ideal-image": "^2.0.0-alpha.55",
|
||||
"@docusaurus/plugin-client-redirects": "^2.0.0-alpha.55",
|
||||
"@docusaurus/preset-classic": "^2.0.0-alpha.55",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue