-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs(v2): add documentation for multiple blogs #2933
Conversation
Deploy preview for docusaurus-2 ready! Built with commit dc176b2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for doing thids! This looks really good! I have some suggested changes before we can merge this.
website/docs/blog.md
Outdated
@@ -163,6 +163,25 @@ Make sure there's no `index.js` page in `src/pages` or else there will be two fi | |||
|
|||
::: | |||
|
|||
### Multiple blogs | |||
|
|||
You can add another blog by specifying your own blog plugin in the `plugins` option. Set the `routeBasePath` to the URL route that you want your blog to be accessed on. Also, set `path` to the path to your blog folder. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recommend using this:
By default, the classic theme assumes only one blog per website and hence includes only one instance of the blog plugin. If you would like to have multiple blogs on a single website, it's possible too! You can add another blog by specifying another blog plugin in the plugins
option for docusaurus.config.js
. Set the routeBasePath
to the URL route that you want your second blog to be accessed on. Note that the routeBasePath
here has to be different from the first blog or else there could be a collision of paths! Also, set path
to the path to the directory containing your other second blog's entries.
website/docs/blog.md
Outdated
[ | ||
'@docusaurus/plugin-content-blog', | ||
{ | ||
routeBasePath: 'my-blog', // URL route for your blog |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'my-second-blog'
website/docs/blog.md
Outdated
'@docusaurus/plugin-content-blog', | ||
{ | ||
routeBasePath: 'my-blog', // URL route for your blog | ||
path: './my-blog', // path to your blog folder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'./my-second-blog'
website/docs/blog.md
Outdated
[ | ||
'@docusaurus/plugin-content-blog', | ||
{ | ||
routeBasePath: 'my-blog', // URL route for your blog |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use comments similar to https://v2.docusaurus.io/docs/using-plugins#docusaurusplugin-content-blog to better elaborate on the options.
I have included your suggested changes, it looks much better now! :D |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much!
Motivation
Add documentation about how to set up multiple blogs.
This PR closes #2481. It also fixes a minor typo.
Have you read the Contributing Guidelines on pull requests?
Yes
Test Plan
The changes can be viewed on Netlify here:
https://deploy-preview-2933--docusaurus-2.netlify.app/docs/blog/#multiple-blogs
Related Information
As noted in #2883, the user needs to add
require.resolve(<plugin-name>)
to the plugin name, in addition to the instructions stated in the documentation.But I have excluded this to maintain consistency with the plugins documentation.
Should I make another PR to add in
require.resolve
for all plugin names?