I have to say that also, the official Ghost tutorial for adding TOC, doesn’t work well with Casper 5. I posted a Bug on Github but I didn’t get a response yet:
TOC Bug with Casper 5.X
It can be “fixed” by adding “margin-bottom: X-px;” to .gh-toc. But it’s a botched.
I’m still unclear as to what you want the result to look like, but if you want to maintain the width and spacing of both the content and your TOC, and just center them together on the page, then try this…
@Joan I just tested the installation instructions for the TOC here…
I tested on a fresh site install on Ghost v 5.2.2 and Casper v 5.1.4
Everything worked perfectly.
Changing some of the widths and spacing in the CSS to prettify your TOC (which looks very nice!) pushed around some other positioning on the page. I still don’t see everything centering or aligning consistently yet on your site when I resize the page.
Thanks for testing all,
Can you test adding a lot of H1, H2 elements? TOC seems to work fine with Casper 5 but if the TOC has a lot of elements like in my image… it’s create a blank space on gh-content.
So far I’m noticing that the space is always to the right of the TOC and extends down to the bottom edge of the TOC… so, the same height as the TOC. It doesn’t seem related to headings like h2 because when I remove the first one at the top of my content, the problem persists with just the p paragraph text being bumped down after the first paragraph.
I also tried the Headline theme with the same result.
Yes! seems to work correctly. In my case not because the .gh-toc “background-color” it cuts. But with “default css design” without background color it’s work with “absolute” position. Something happens with relative position and the blank space… It’s strange…
If you try to add “margin-bottom: X-px” to .gh-toc in relative position it’s seems to repair, but…
Hi!
I have a “problem”. Could you help me?
I have added a style to “.gh-content li” so that the numbers are displayed differently. But… it is also added to the ToC.
The custom CSS code:
.gh-content ol {
margin: 0;
padding: 0;
list-style-type: none;
}
.gh-content li {
counter-increment: step-counter;
margin-bottom: 5px;
}