Skip to content
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): document about allowing multiple blogs #2481

Closed
anothermomo opened this issue Mar 29, 2020 · 5 comments · Fixed by #2933
Closed

docs(v2): document about allowing multiple blogs #2481

anothermomo opened this issue Mar 29, 2020 · 5 comments · Fixed by #2933
Labels
difficulty: starter Issues that are starter difficulty level, e.g. minimal tweaking with a clear test plan. documentation The issue is related to the documentation of Docusaurus mlh Major League Hacking Fellowship

Comments

@anothermomo
Copy link

🚀 Feature

I want to use docusaurus to organize my blog posts, which have different categories.

If I put these blog posts under the docs folder, I will need to manually add these blog posts to the sidebar, that would be a burdensome task.

If there is only one blog folder, I will not be able to sort these blog posts well.

Have you read the Contributing Guidelines on issues?

Yes.

@anothermomo anothermomo added feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future. status: needs triage This issue has not been triaged by maintainers labels Mar 29, 2020
@hotlong
Copy link

hotlong commented Apr 1, 2020

+1

@yangshun yangshun removed the status: needs triage This issue has not been triaged by maintainers label Apr 5, 2020
@yangshun
Copy link
Contributor

yangshun commented Apr 5, 2020

Is this for v2 or v1? It's not that obvious, but in v2 you can have multiple blogs as long as you specify your own blog plugin under the plugin section. Maybe we should be documenting this instead.

@yangshun
Copy link
Contributor

yangshun commented Apr 5, 2020

I just tested it and it works

plugins: [
    // ...
    [
      '@docusaurus/plugin-content-blog',
      {
        routeBasePath: 'my-blog',
        editUrl:
          'https://github.com/facebook/docusaurus/edit/master/website/my-blog',
        postsPerPage: 2,
        feedOptions: {
          type: 'all',
          copyright: `Copyright © ${new Date().getFullYear()} Facebook, Inc.`,
        },
      },
    ],
  ],
],

So what we have to do here is to document how to add another blog under /docs/blog/

@yangshun yangshun changed the title Allow adding multiple blogs docs(v2): document about allowing multiple blogs Apr 5, 2020
@yangshun yangshun added difficulty: starter Issues that are starter difficulty level, e.g. minimal tweaking with a clear test plan. documentation The issue is related to the documentation of Docusaurus and removed feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future. labels Apr 5, 2020
@anothermomo
Copy link
Author

Is this for v2 or v1? It's not that obvious, but in v2 you can have multiple blogs as long as you specify your own blog plugin under the plugin section. Maybe we should be documenting this instead.

Hi, yangshun, thanks for your reply.

This is for v1.

And in addition, I've find out that the TOC (Table Of Content), which is a important feature for me, is not available by default in v2, is this also can to be achieved by specifying the plugin?

@fanny
Copy link
Contributor

fanny commented Apr 6, 2020

I just tested it and it works

plugins: [
    // ...
    [
      '@docusaurus/plugin-content-blog',
      {
        routeBasePath: 'my-blog',
        editUrl:
          'https://github.com/facebook/docusaurus/edit/master/website/my-blog',
        postsPerPage: 2,
        feedOptions: {
          type: 'all',
          copyright: `Copyright © ${new Date().getFullYear()} Facebook, Inc.`,
        },
      },
    ],
  ],
],

So what we have to do here is to document how to add another blog under /docs/blog/

Is basically provide other object like:

plugins: [
    // ...
    [
      '@docusaurus/plugin-content-blog',
      {
        routeBasePath: 'my-blog',
        editUrl:
          'https://github.com/facebook/docusaurus/edit/master/website/my-blog',
        postsPerPage: 2,
        feedOptions: {
          type: 'all',
          copyright: `Copyright © ${new Date().getFullYear()} Facebook, Inc.`,
        },
      },
     {
        routeBasePath: 'my-blog2',
        editUrl:
          'https://github.com/facebook/docusaurus/edit/master/website/my-blog2',
        postsPerPage: 2,
        feedOptions: {
          type: 'all',
          copyright: `Copyright © ${new Date().getFullYear()} Facebook, Inc.`,
        },
      },
    ],
  ],
],

And can we route for both things?

@yangshun yangshun added the mlh Major League Hacking Fellowship label Jun 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: starter Issues that are starter difficulty level, e.g. minimal tweaking with a clear test plan. documentation The issue is related to the documentation of Docusaurus mlh Major League Hacking Fellowship
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants