mkdocs: mkdocs start error following pages exist in the docs directory, but are not included in the "nav" configuration:

I get the following error when I start mkdocs. Now this works fine on one computer and not another. One computer I am running python 3.5.1 and one I am running 3.7.4. I think that is the only difference.

This is the error

mkdocs serve
INFO    -  Building documentation...
INFO    -  Cleaning site directory
INFO    -  The following pages exist in the docs directory, but are not included in the "nav" configuration:
  - index.md
  - management.md
  - tech.md
WARNING -  A relative path to 'docs/index.md' is included in the 'nav' configuration, which is not found in the documentation files
WARNING -  A relative path to 'docs/tech.md' is included in the 'nav' configuration, which is not found in the documentation files
[I 191002 17:30:02 server:296] Serving on http://127.0.0.1:8000
[I 191002 17:30:02 handlers:62] Start watching changes
[I 191002 17:30:02 handlers:64] Start detecting changes
[I 191002 17:30:05 handlers:135] Browser Connected: http://localhost:8000/
[I 191002 17:30:06 handlers:135] Browser Connected: http://localhost:8000/

this is what my .yml file looks like

site_name: Interview

nav:
- HR: 'docs/index.md'
- TECH: 'docs/tech.md'
- Management: '/docs/management'

Again, this is working on one computer. I tried to uninstall phyton 3.7 and install the same as I have on my other computer but 3.5.1 have been superseded and I couldn’t seem to get an exe file for it pip version 19.2.3 on both computers

So when I go to localhost:8000 the first page shows up “index”, but if I go to the nav on the page and click the HR item, I get a 404, all of the nav items I get a 404.

Thanks for any help

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 2
  • Comments: 26 (12 by maintainers)

Most upvoted comments

It does not sound like a Material problem. Please open a new issue here with all the necessary information: your MkDocs.yml, your directory and files structure, your MkDocs and Python versions, and your operating system.

@dangtd77 Please see in documentation the explanation for the navigation configuration:

A simple navigation configuration looks like this:

nav:
  - 'index.md'
  - 'about.md'

All paths in the navigation configuration must be relative to the docs_dir configuration option. If that option is set to the default value, docs, the source files for the above configuration would be located at docs/index.md and docs/about.md.

This means your navigation configuration is wrong. Remove docs from your pages and use only index.md, tech.md, etc.