-
-
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
Changes from 4 commits
eef6283
65381b5
71d64be
2c4945f
dc176b2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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. | ||
|
||
```js {4-10} title="docusaurus.config.js" | ||
module.exports = { | ||
// ... | ||
plugins: [ | ||
[ | ||
'@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 commentThe reason will be displayed to describe this comment to others. Learn more. 'my-second-blog' There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
path: './my-blog', // path to your blog folder | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
}, | ||
], | ||
], | ||
}; | ||
``` | ||
|
||
<!-- | ||
|
||
Adding a blog using the blog plugin. | ||
|
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 fordocusaurus.config.js
. Set therouteBasePath
to the URL route that you want your second blog to be accessed on. Note that therouteBasePath
here has to be different from the first blog or else there could be a collision of paths! Also, setpath
to the path to the directory containing your other second blog's entries.