signalwerk / gatsby-remark-table-of-contents

gatsby remark plugin to generate table of contents
21 stars 10 forks source link

Render title inside table of content block #2

Closed betojsx closed 4 years ago

betojsx commented 4 years ago

Hi. Is it possible to render an optional title inside the table of contents block?

It could be a default title, like Table of Contents obviously or another title defined in the configs or (what I actually need) the article title from frontmatter.

I was not able to figure out how to do it myself so help appreciated.

and thanks for the plugin!

signalwerk commented 4 years ago

@betodasilva May I ask you about your use case? Can't you just write your title in markdown? Like in the documentation:

## Your title for table of contents

```toc
exclude: Your title for table of contents
from-heading: 2
to-heading: 6
betojsx commented 4 years ago

Hi @signalwerk

I thought it would be good for SEO to have the page title right above the table of contents to help get featured in google snipets but in three days I've changed my mind.

I'm seeing a increase in bounce rate so I'm removing the TOC since my articles are not too long.

Anyways thanks for your kindness.

signalwerk commented 4 years ago

@betodasilva thank you for your input. I didn't think of SEO. If you have an input how to improve the tags/semantics of the TOC I'm open for it.