Skip to content

side-nav only shows items nested 2 levels deep #193

@lispcat

Description

@lispcat

Description

The side-nav will only show items nested 2 levels deep. I've tried tweaking the markdown_extensions.toc.toc_depth and markdown_extensions.toc.baselevel variables, but got the same results.

Reproduction

mkdocs.yml:

site_name: test site

docs_dir: docs
site_dir: site

nav:
  - Home: index.md
  - level1:
    - level2:
      - About: about.md

theme:
  name: terminal

markdown_extensions:
  - toc:
      baselevel: "3"
      toc_depth: "3"

docs subdir structure:

├── docs
│   ├── about.md
│   └── index.md

docs/about.md:

this is the about.md file

docs/index.md:

this is the index.md file

Result:
Image

Expected: I expected an About item nested below the level2 item.

Temporary workaround

I modified terminal/partials/side-nav/side-nav-item.html to support further nested items, but it's a dirty hack and could've broken something else:

lispcat@a1e2da7

Environment

  • mkdocs ver: 1.6.1
  • mkdocs-terminal ver: 4.7.0
  • pip ver: 25.2
  • OS: NixOS
  • browser: Librewolf
  • dev environment tool: devenv
    • devenv.nix:
{ pkgs, lib, config, inputs, ... }:

{
  env.GREET = "devenv";

  packages = [ pkgs.git ];

  languages.python = {
    enable = true;
    venv.enable = true;
    venv.requirements = ''
      mkdocs
      mkdocs-terminal
    '';
  };

  scripts = {
    docs-dev.exec = ''
      mkdocs serve
    '';
  };
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    communitycommunity contributionsenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions