Table of Contents Plugin for Squarespace 7.1
Hereβs how to use this table of contents plugin:
Copy the code below
Paste it into a new code block at the top of your blog post (*only works on blog pages)
Get a TOC like the one you see just below!
Table of Contents
Looking for something else?
Check out my other TOC plugins:
What Is the Table of Contents Plugin?
This Squarespace table of contents (TOC) plugin is a simple piece of code you can use in a code block element for any page or blog post.
It auto-generates a clickable list of your post's headings (like H2s, H3s, H4s). So when someone clicks a section, it scrolls them right to that part of your blog post. Very scroll-savvy. Very UX-friendly.
Why Use A Table of Contents Plugin?
Thereβs no native TOC feature in Squarespace. So why bother using one?
Here are the biggest reasons:
Makes long posts easier to navigate
Better UX β helps readers scan easily
Boosts your SEO by improving structure and accessibility
Encourages more on-page time (Google loves that)
Also, it just looks clean.
How to Use This Squarespace Plugin
Paste the entire code (HTML + JS + CSS) into a Code Block at the top of any blog post
The TOC will only show up if your post includes at least one
<h2>
,<h3>
or<h4>
The βShow/Hideβ button lets visitors toggle the full table on and off
And thatβs it! No backend CSS or extra technical steps.
How to Customize This Dang Plugin
βοΈ Edit the Button Color
Update the #toggle-toc
button by changing the border and text color here:
#toggle-toc {
border: 1px solid #27A2B7;
color: #27A2B7;
}
#toggle-toc:hover {
background: #27A2B7;
}
Swap in your own brand hex code (or play around with transparency, gradients, whatever you want).
π¨ Adjust TOC Styling (optional)
You can customize:
The container background:
#toc-container { background: #f8f9fa; }
The title font size:
.toc-title { font-size: 24px; }
*Edit the mobile version padding or spacing using the @media
block at the bottom of the CSS.
Want more plugins? Check out my personal library!
π Expandable Table of Contents for Squarespace
Copy and paste this into a Code Block inside your Blog Post Template.