Hello everyone
I am using the fabulous Solo Theme but only thing is missing : a table of contents.
I am wondering if it is possible to implement a table of contents easily (without coding) without upgrading my Starter pack subscription ?
If not, is there another solution â again, without coding ?
The approach here can be used in a mix of code injection and an html card in the post editor,
Youâll likely have to tweak some css selectors.
1 Like
Raki
August 9, 2024, 6:27pm
3
You can try the table of contents widget , you can add TOC by simply copying code into âCode injectionâ.
Here is the guide on how to use it.
I already checked this method before asking the question, but they donât really say you can insert it before your OG post.
Thanks
Iâll have a look at it.
But how does it display eventually?
Raki
August 10, 2024, 5:32pm
6
You can check this link for eventual display
Ha okay
It is not a floating TOC on desktop apparently.
On the phone, it does seem not sticking to the top of the screen where we can go to any section of the blog post.
Is it correct?
The problem is that I wrote 3000 words articles as an average. So, itâs more convenient to make it more UX friendly.
Do you think we can make it another way ?
If nor, I should buy a theme accordingly.
ROY
August 10, 2024, 6:23pm
8
Raki:
link
This is a good resource. But it does not work with most themes. I have checked Headline, Source, Journal, etc. It would have been great if Ghost team provided theme specific ToC :)
Raki
August 10, 2024, 6:44pm
10
On desktop, it is sticky alongside the content, while on mobile, it appears at the position itâs inserted.
Do you think we can make it another way ?
Of course, I can add more display options for the widget. Can you provide me with a display example?
Raki
August 10, 2024, 6:45pm
11
The TOC in my link is generated using my TOC widget . It is compatible with most themes as it automatically detects the content container and adapts accordingly.
Yeah sure
Sound perfect for the desktop version.
1 Like
Raki
August 12, 2024, 2:49am
14
I added a new style option: " Always Sticky", and you can view its display effects at âAlways Stickyâ Demo
Thank you for the modification
I tried on both plateforms (desktop and smartphone).
Here are the screenshots of how it looks.
On the phone, sometimes, it goes that way.
A link to a video about how it behaves on the phone :
Quick improvements (according to me) :
While scrolling down, try to make it sticky right away. Now, it goes sticky after once scrolling down AND scrolling back up.
Put grey border 1px (or 2) solid without shadows, depending on the background of the page.
Make the TOC take the whole screen.
Donât cut off the headings, start a new line instead.
Make the font size of the whole TOC smaller. One size for the top title âTable of contentsâ and one size for all the headings (a bit smaller).
Here is the link of another video about how a TOC should behave (but it is my perspective ) :
I hope it helps you to improve your TOC
Raki
August 12, 2024, 9:59am
17
Thank you for your feedback. I will consider your suggestions.
Regarding the screenshots:
You can adjust TOC to appear at the right side, so it wonât overlap with author info.
I will fix the overlay problem on phone screen.
Raki
August 21, 2024, 12:47am
18
Hi Jeremy, I have fixed the bugs, updated the styles and added more config options.
You can view the new style at: Always Sticky TOC
To make the TOC work for your site, please go to Rakihub TOC and select:
âAlways stickyâ style
âRightâ for âposition on desktopâ
Your prefered font size for TOC heading and title
Hello @Raki ,
I tried to set it up on one of my pages.
Hereâs how it looks like :
The title of TOC appears twice as you link-logo.
Personnally, Iâd rather make the headings fonts smaller, like 10px (as I saw on another Ghost theme) to make it more readable.
Example :
There is another issue, but I donât know if it is linked to my Solo theme.
It crosses the main pic.
How to make the TOC sticky under the image ?
Hereâs how it looks on the phone :
FYI, hereâs the code I used :
<script src="https://cdn.jsdelivr.net/gh/rakihub/ghost-code-injection@toc-v1.4/toc/free/built/free.min.js" defer></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/rakihub/ghost-code-injection@toc-v1.4/toc/free/built/free.css">
<aside class="raki-toc-container"data-toc="h6,2" data-style="style-sd,side-l" data-container="trun-n,font-sm" data-title="t-TABLE OF CONTENTS,bold-y,font-base" data-link="bold-y" ></aside>
Thanks for the reply.
Hope itâs helping .
Raki
August 23, 2024, 6:16pm
20
The title of TOC appears twice as you link-logo
Seems like you injected the code twice, please check your âCode injection => site headerâ if there is any duplicate code related with ârakihub/ghost-code-injectionâ
How to make the TOC sticky under the image ?
Seem strange, I canât reproduce this with Solo theme, is it possible to give me a link and let me check?
Hereâs the link of my blog :
Go on any blog post and youâll see by yourself.
I just removed the TOC because of visitors coming.
You can add it manually in the code I suppose.