So, I really don’t know much about code but followed the tutorial for creating a TOC:
but then I noticed that it messed up with the “publication-info sidebar” in Homepage. I’m using Source Theme and need some help to configure a proper TOC in my blog posts.
Add .gh-content to the styles of the TOC in default.hbs
.gh-content .gh-sidebar {
position: absolute;
top: 0;
bottom: 0;
margin-top: 4vmin;
grid-column: wide-start / main-start; /* Place the TOC to the left of the content */
}
Thanks, Raki. Somehow, the TOC sidebar didn’t move to the side using the code in the guide you provided. I’ll try some tweaking to see if I can fix it.
I have two articles about how I wrote a component that automatically builds the Table of Contents for your posts. You can see its functionality in almost every one of my publications.
In the first part, we will explore the problem in more detail, examine alternative solutions, and develop our own component based on the idea. I will also explain how to use it.
In the second part, we will significantly improve it and simplify its use. The second version of the component builds a multi-level Table of Contents.
By the way, the second version can be adapted not only for Ghost