Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account in theme directory overrides in docs #1766

ruuda opened this issue Mar 10, 2019 · 1 comment
Closed in theme directory overrides in docs #1766

ruuda opened this issue Mar 10, 2019 · 1 comment


Copy link

ruuda commented Mar 10, 2019


MkDocs will generate index.html from in the theme directory, even if exists in the docs directory.

Steps to reproduce

Consider the following minimal example:

├── docs
│   └──
├── mkdocs.yml
└── theme
    ├── main.html


The right index.


The wrong index.


{{ page.content }}


site_name: Repro
  name: null
  custom_dir: theme
  - Overview:

After running mkdocs build, the following index.html is produced:

<p>The wrong index.</p>

Furthermore, mkdocs build emits the following message:

INFO    -  The following pages exist in the docs directory, but are not included in the "nav" configuration:

This is especially surprising, because the the docs say:

If both an file and a file are found in the same directory, then the file is used and the file is ignored.

I would expect markdown files in the theme directory to not affect how the documentation is built, unless they are specifically included from a template.

$ mkdocs --version
mkdocs, version 1.0.4 from /usr/lib/python3.7/site-packages/mkdocs (Python 3.7)
Copy link

waylan commented Mar 13, 2019

I expect this was fixed in #1672, which will be available in the next release. However, it occurs to me that perhaps we should exclude all Markdown files from the theme directory, or at least README files. A Theme should not be able to add "pages" to a site and README files in a theme would not be content either.

waylan added a commit to waylan/mkdocs that referenced this issue Mar 13, 2019
waylan added a commit that referenced this issue Mar 13, 2019
Account for capitalization differences and all supported Markdown extensions. Fixes #1766.
ruuda added a commit to ruuda/kilsbergen that referenced this issue Jun 27, 2021
Previously it could not be called, due to a bug in MkDocs [1].
This bug has been fixed in version 1.1, which was released earlier this

[1]: mkdocs/mkdocs#1766
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

No branches or pull requests

2 participants