Chris Bolton
Chris Bolton

Reputation: 2314

How to remove the buttons for previous and next in mkdocs?

I am trying to remove these buttons labeled "Previous" and "Next" in mkdocs:

buttons to remove

I have read the docs and searched the web but haven't found anything other than some GitHub issues like:

How to remove the buttons in a not so hacky way?

Upvotes: 4

Views: 1538

Answers (2)

Capybara
Capybara

Reputation: 784

One way to accomplish this with the default theme on MkDocs 1.6.0 is to override the related css.

  1. Add or make sure you have a stylesheet to override the default theme.
├── docs
    └── stylesheets
          └── extra.css
  1. Add the following css to extra.css:
.nav-link[rel="next"] {display: none;}
.nav-link[rel="prev"] {display: none;}
  1. Make sure the relative path to the overriding css is noted in the mkdocs.yml:
theme: mkdocs
extra_css:
  - stylesheets/extra.css

Upvotes: 2

Alinex
Alinex

Reputation: 979

I would do this using CSS to hide it by adding into the included css. In the material theme it will be:

md-footer__inner { display: none }

This should be within the css which is included as extra_css in the mkdocs.yml.

Upvotes: 5

Related Questions