Mkdocs-material: How to use tabs navigation?

Created on 18 Jul 2018  路  2Comments  路  Source: squidfunk/mkdocs-material

Description

I know there is a link to "enable" tabs feature.

But the question is, how do I add others?

By default, I have a "Home" tab here, but what I need to do if I want to have a "Resources", "Download", "Credits", etc..

I need an example about how to add others tabs not just enable tabs feature.


I tried to use:

  feature:
    tabs:
      - Home: index.md
      - About: about.md

But it not work.

And I tried to use:

---
tabs: true
---

in page file (like index.md), but it does not work either.

Thank you for any hint!

Package versions

  • Python: 2.7.15
  • MkDocs: 0.17.5
  • Material: 2.9.2

Project configuration

site_name: Sample Site
theme:
  name: 'material'
  language: 'zh'
  feature:
    tabs: true
extra:
  search:
    language: 'zh'
pages:
  - Home: index.md
  - About: about.md
use_directory_urls: false

Related Issues

Most helpful comment

Solved. Finally, I find an example from the official document config file.
See: https://github.com/squidfunk/mkdocs-material/blob/master/mkdocs.yml
Example:

# Page tree
pages:
  - Material: index.md
  - Getting started: getting-started.md
  - Extensions:
    - Admonition: extensions/admonition.md
    - CodeHilite: extensions/codehilite.md
    - Footnotes: extensions/footnotes.md
    - Metadata: extensions/metadata.md
    - Permalinks: extensions/permalinks.md
    - PyMdown: extensions/pymdown.md
  - Specimen: specimen.md
  - Customization: customization.md
  - Compliance with GDPR: compliance.md
  - Release notes: release-notes.md
  - Author's notes: authors-notes.md
  - Contributing: contributing.md
  - License: license.md

All 2 comments

Solved. Finally, I find an example from the official document config file.
See: https://github.com/squidfunk/mkdocs-material/blob/master/mkdocs.yml
Example:

# Page tree
pages:
  - Material: index.md
  - Getting started: getting-started.md
  - Extensions:
    - Admonition: extensions/admonition.md
    - CodeHilite: extensions/codehilite.md
    - Footnotes: extensions/footnotes.md
    - Metadata: extensions/metadata.md
    - Permalinks: extensions/permalinks.md
    - PyMdown: extensions/pymdown.md
  - Specimen: specimen.md
  - Customization: customization.md
  - Compliance with GDPR: compliance.md
  - Release notes: release-notes.md
  - Author's notes: authors-notes.md
  - Contributing: contributing.md
  - License: license.md

Hi @LazyKnightX Can you please explain how you did it!

Was this page helpful?
0 / 5 - 0 ratings