I am new into Strapi, currently building my blog using it + Gatsby.
I wonder how can I create a table of contents in my blog. I need to retrieve the headings that appear on my text, which is a enriched text field. Is it possible?
I was also thinking in creating another content type just for adding the headings that I need to catch in each post, but I don’t know if it’s the best way to do it.
Hey, you should separate your heading title from your content. That’s a bad practice to keep all your page’s content in the same field since it will be hard to maintain in the future. You can’t achieve your needs if you put title and content together. For blog articles, you should have at least a few separated fields: Title, content, category, cover image (if your blog has a cover image). Do not keep all your eggs in one basket.
There is no need to create another content-type, just add a new field(heading or title) to your existing content-type and manually delete the heading from the content and put it inside the title field, then add it to your gatby app.