Table of contents displays locally but not on GitHub pages

Hello! I have the following snippet of the preamble for a post:

---
layout: post
toc: true
mathjax: true
mermaid: true
---

The table of contents displays just fine locally. But when I publish the site on GitHub pages, the table of contents is not displayed and doesn’t appear to be in the source. I’m not for sure where to go to resolve this or why this is happening. The table of contents feature is provided by the jekyll-toc.

Does anyone have any ideas? How is the static site differing between local and GitHub pages?

GH only allows certain plugins and I don’t see that on the list:

I think if you use GH Actions you can do it, or you could push the site folder to GH and they would host that but that is a pain.

1 Like

Ah, I didn’t realize that there were limitations on the Jekyll plugins. Thank you for the heads up there!

A table of contents plugin definitely seems strange not to be sanctioned, so to speak, but your comment helped me solve the problem.

I went ahead and setup a GitHub Actions workflow to build and deploy my main branch to a gh-pages branch that GitHub Pages then publishes.

For others with this issue, I followed the documentation here:

Be sure to update the version to @v2 to get the latest version. (2.0.5 contains some deprecated token management.)