Adding a table of contents

I’ve just managed to get time to come back to this now and realised the suggestion from @RyanF is to give up on adding it to the left and to instead add it to the right.

I’m not keen on that so I’ll outsource this rather than find more time myself if no further suggestions.

I would love for the Ghost team to include ToC for all of their Official themes. Fingers crossed!

1 Like

Not gonna happen I think. Table of contents usually looks very bad on mobile and mostly are used in very long, SEO-optimized content.

1 Like

It is indeed a hassle as they hardly some good guidelines of how to do it with different themes

But I thought ToC was good for SEO and rankings.

Yes, it would be good to have this native as part of each theme. ToC has become essential for every site and so I’m surprised it is not included natively for each theme.

1 Like

It is, in fact they did a guide to add it to the main theme back then (Casper). But I doubt Ghost’s first priority is SEO.

1 Like

It would be great if this functionality was built into Ghost. I found it on Ghost’s official site (example: 🎉 Newsletter resolutions), but didn’t realize it required custom code until I found this post.

Does anyone know of any Ghost themes that include the table of contents?

1 Like

I’ve developed a Table of Contents (TOC) widget that automatically generates a TOC for your posts. It allows you to customize the TOC styles and easily add it to your Ghost blog by simply copying and pasting the code.
You can try it out here:

The widget offers two styles:
:point_right: Sticky on Desktop
:point_right: Always Sticky

Hi all,

In case if somebody is looking for a version of TOC which auto-generates tree in any place of your article please check out this version.

Features:

  • Does not have any dependencies
    • won’t load any 3rd party scripts/styles
    • means won’t have any loading delays
  • Support different titles / multiple languages
  • Support multi-level trees (h2-h6)

Here is an instruction: