hikerpig / gatsby-plugin-tocbot

A gatsby plugin for adding tocbot, display table of contents

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gatsby-plugin-tocbot

Add tocbot to your gatsby site.

Install

yarn add gatsby-plugin-tocbot

Usage

// gatsby-config.js

module.exports = {
  plugins: [{
    resolve: 'gatsby-plugin-tocbot',
    options: {
      tocbotOptions: {
        contentSelector: '.js-toc',
        collapseDepth: 5,
      }
    },
  }]
}

Customization

Override thes css variables in your css.

/** default values */
:root {
  --toc-cur-highlight-color: black;
  --toc-text-color: inherit;
  --toc-text-hover-color: #666;
}

About

A gatsby plugin for adding tocbot, display table of contents


Languages

Language:CSS 54.6%Language:JavaScript 45.4%