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

Feature Suggestion: Table of Contents (TOC) #936

Open
byungjin0826 opened this issue Jun 9, 2024 · 6 comments
Open

Feature Suggestion: Table of Contents (TOC) #936

byungjin0826 opened this issue Jun 9, 2024 · 6 comments

Comments

@byungjin0826
Copy link

Hi timlrx,

I hope this message finds you well. Firstly, I want to express my gratitude for developing and maintaining the package. It has been incredibly useful for creating and managing my blog, and I appreciate all the effort you’ve put into it.

I have a suggestion that I believe could enhance the usability and functionality of the package: the addition of a Table of Contents (TOC) feature.

Currently, the package provides excellent tools for blog creation and management, but I feel that adding a TOC feature could significantly improve the user experience. Here are a few reasons why:

  • Improved Navigation: A TOC would allow readers to easily navigate through longer blog posts, quickly jumping to sections of interest without scrolling.
  • Better Content Organization: It helps in organizing the content more effectively, making it more readable and user-friendly.
  • Enhanced SEO: Search engines often use TOCs to understand the structure of a page, potentially improving the blog’s SEO performance.

If this feature could automatically generate a TOC based on the headers within the post, it would greatly streamline the process for users.

Additionally, if this feature is already available within the package and I might have missed it, could you please guide me on how to implement or enable it?

Please let me know if you need any further details or if there’s any way I can assist in implementing this feature. I’d be happy to contribute in any way possible.

Thank you for considering my suggestion. I look forward to any updates or feedback you might have.

@timlrx
Copy link
Owner

timlrx commented Jun 9, 2024

It already exists, but it's an opt-in feature for each post so you can insert it where it fits best. Check out https://tailwind-nextjs-starter-blog.vercel.app/blog/new-features-in-v1#table-of-contents-component.

Just include the following component in your post: <TOCInline toc={props.toc} />. You can see an example in the raw markdown file as well.

@PxlSyl
Copy link
Contributor

PxlSyl commented Jun 10, 2024

Hi, yes it already exists. I recently implemented the toc feature as an automatic sidebar when navigating to the posts (I may modify it to make it optional) on my i18n version, the reason I did this is for long blog posts and accessibility: I think it's better to have a floating button that can trigger the toc component, than the TOC at the top of the posts. If @timlrx is okay, I may do some PR for some of the features I implemented :)

@timlrx
Copy link
Owner

timlrx commented Jun 10, 2024

@PsyGik it's probably too feature-packed for my liking haha but feel free to share the implementation and others can copy it if that's what they are looking for. If the code is not too long, you could consider adding it to the FAQ as well.

@byungjin0826
Copy link
Author

Thank you both for your responses(@PxlSyl @timlrx ). I am looking forward to using the floating TOC. I will refer to your implementation and make use of it.

@PxlSyl
Copy link
Contributor

PxlSyl commented Jun 10, 2024

@PsyGik it's probably too feature-packed for my liking haha but feel free to share the implementation and others can copy it if that's what they are looking for. If the code is not too long, you could consider adding it to the FAQ as well.

Np, I'll try to do that. I was talking about some features like series or share components (not all features but some common ones), but it's really as you want :)

@Misaki-Akeno
Copy link
Contributor

QQ_1720186414589
I believe having a TOC in the sidebar, similar to this, would be a good option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants