do-me
do-me

Reputation: 2178

Right way to change mkdocs markdown toc title "table of contents"?

I'm using mkdocs with material layout and toc markdown extension for adding a toc to the right for a documentation project.

I use up42's wiki as a template for my wiki. I would like to change the title "Table of contents".

Table of contents

The toc markdown documentation provides a parameter "title" that doesn't change anything when used in my mkdocs.yml:

markdown_extensions:
  - markdown.extensions.toc:
      baselevel: 1
      permalink: true
      title: "SOMETITLE"

Does anyone have a clue which parameter to use or how to change the title?

Upvotes: 0

Views: 2792

Answers (2)

squidfunk
squidfunk

Reputation: 431

This feature was added in Material for MkDocs 7.3.5 (which you are using as can be inferred from the screenshot). The syntax is exactly as you specified in your original post:

markdown_extensions:
  - toc:
      title: On this page

For further guidance please refer to the documentation.

Upvotes: 3

do-me
do-me

Reputation: 2178

Using CSS

I didn't find the right parameter or the problem yet, but a simple CSS overset does the job pretty well (thanks to this answer):

.md-nav__title {
  visibility: hidden;
}

.md-nav__title:after {
  visibility: visible;
  content: 'SOMETITLE';
  display: block;
}

Upvotes: 0

Related Questions