Skip to content

Commit

Permalink
docs(v2): improve documentation for multiple blogs
Browse files Browse the repository at this point in the history
  • Loading branch information
teikjun committed Jun 14, 2020
1 parent 2c4945f commit dc176b2
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 8 deletions.
17 changes: 13 additions & 4 deletions website/docs/blog.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,17 +165,26 @@ 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.
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`.

```js {4-10} title="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 second blog's entries.

```js title="docusaurus.config.js"
module.exports = {
// ...
plugins: [
[
'@docusaurus/plugin-content-blog',
{
routeBasePath: 'my-blog', // URL route for your blog
path: './my-blog', // path to your blog folder
/**
* URL route for the blog section of your site.
* *DO NOT* include a trailing slash.
*/
routeBasePath: 'my-second-blog',
/**
* Path to data on filesystem relative to site dir.
*/
path: './my-second-blog',
},
],
],
Expand Down
17 changes: 13 additions & 4 deletions website/versioned_docs/version-2.0.0-alpha.56/blog.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,17 +161,26 @@ 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.
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`.

```js {4-10} title="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 second blog's entries.

```js title="docusaurus.config.js"
module.exports = {
// ...
plugins: [
[
'@docusaurus/plugin-content-blog',
{
routeBasePath: 'my-blog', // URL route for your blog
path: './my-blog', // path to your blog folder
/**
* URL route for the blog section of your site.
* *DO NOT* include a trailing slash.
*/
routeBasePath: 'my-second-blog',
/**
* Path to data on filesystem relative to site dir.
*/
path: './my-second-blog',
},
],
],
Expand Down

0 comments on commit dc176b2

Please sign in to comment.