Please add table of contents
xfzka opened this issue · 9 comments
Hi, can you expand on what you mean by this?
Sorry my English is bad.
This function may call TOC.
Here is the official document https://gohugo.io/content-management/toc/
I've attached a PR, please review it and let me know if it's what you were getting at.
You’ll need to add {{< toc >}}
in the Markdown where you want to insert the table of contents.
Thank you, add {{< toc >}}
to my Markdown article is work very well 😊.
Can you please make the TOC auto generate?
By auto generate do you mean automatically generate for every page without using {{< toc >}}
? Or do you mean it should auto generate titles? It should use the header elements in your article to create the table of contents.
Yes, I mean automatically generate for every page without using {{< toc >}}
.
If you don't like this feature,please add a config option to control it, many people like me love TOC feature.
Thanks for the request. I've thought about this, but the reason I added the shortcode to generate a table of contents was to allow it to be placed anywhere on the page. The added complexity of a global table of contents flag would create strange interactions if the page already has the table of contents shortcode, so I'm not going to add this as an option. Closing this issue and merging the associated PR.