Skip to content

Add Toc to blog posts #2717

Closed
Closed

Description

@donaldboulton

💥 Proposal

(A clear and concise description of what the proposal is.)

Docusarus v2 -54
How to add a Table Of Contents to Blog Posts like docs have.

Have you read the Contributing Guidelines on issues?

(Write your answer here.)

Activity

  1. added
    status: needs triage
    proposal
    on May 3, 2020
  2. yangshun commented on May 5, 2020

    @yangshun
    Contributor

    Swizzle the components.

  3. skychx commented on Jul 11, 2020

    @skychx

    Swizzle the components.

    sorry, I don't understand the meaning of "Swizzle the components"。

    I read the V2 documentation and it seems that only Docs has TOC, but V1's blog supports TOC

  4. skychx commented on Jul 11, 2020

    @skychx

    Swizzle the components.
    image

    image

  5. skychx commented on Jul 12, 2020

    @skychx

    Swizzle the components.
    image

    image

    Finally, I use

    yarn run swizzle @docusaurus/theme-classic

    change src/theme/BlogPostPage/index.js add the Toc

  6. slorber commented on Jul 13, 2020

    @slorber
    Collaborator

    Yes @skychx you can swizzle the blog post page, it should have a property "rightToc" assigned to it, and you can reuse the Headings comp of the classic theme to render it.

    Do you think we should provide this feature out of the box for blog posts too?

  7. skychx commented on Jul 14, 2020

    @skychx

    Yes @skychx you can swizzle the blog post page, it should have a property "rightToc" assigned to it, and you can reuse the Headings comp of the classic theme to render it.

    Do you think we should provide this feature out of the box for blog posts too?

    YES! I think this is a very useful feature to clearly show the structure of the article.

  8. added
    mlh
    and removed
    status: needs triage
    on Jul 14, 2020
  9. muhsatrio commented on Jul 24, 2020

    @muhsatrio

    Swizzle the components.
    image

    image

    may I shoot PR for adding the "Recent Post" section to v2 docusaurus? I think this feature is still needed, thank you @slorber

  10. slorber commented on Jul 24, 2020

    @slorber
    Collaborator

    Recent posts and TOC seems like useful things PR welcome 👌

  11. amy-lei commented on Aug 10, 2020

    @amy-lei
    Contributor

    I would love to work on the TOC feature! 😃

  12. slorber commented on Aug 11, 2020

    @slorber
    Collaborator

    yes @amy-lei thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    mlhproposal

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions