Skip to content

Allow docs to be in the root directory#60

Draft
oprypin wants to merge 4 commits intonextfrom
same
Draft

Allow docs to be in the root directory#60
oprypin wants to merge 4 commits intonextfrom
same

Conversation

@oprypin
Copy link
Copy Markdown
Member

@oprypin oprypin commented Mar 20, 2026

If the config file is inside docs_dir, you get this message:

ERROR   -  Config value 'docs_dir': The 'mkdocs.yml' config file should not be inside the docs_dir.
           To allow this arrangement, please exclude the file (and other files as applicable) by adding the following configuration:

           exclude_docs: |
             /mkdocs.yml

If the site_dir is inside docs_dir, you get this message:

ERROR   -  Config value 'site_dir': The site_dir should not be inside the docs_dir as this leads to the build directory being copied into itself.
           To allow this arrangement, please exclude the directory (and other files as applicable) by adding the following configuration:

           exclude_docs: |
             /site
```Fix bypassing it when:

* a non-absolute config_file_path is passed on the command line
* the directory is not an *exact* parent of the other one, but is instead a "grandparent".

Also validate it in `mkdocs serve` because why reserve the check only to `mkdocs build`.

Fix bypassing it when:

* a non-absolute config_file_path is passed on the command line
* the directory is not an *exact* parent of the other one, but is instead a "grandparent".

Also validate it in `mkdocs serve` because why reserve the check only to `mkdocs build`.
@oprypin oprypin changed the title Fix edge cases in validation of docs_dir/site_dir Allow docs to be in the root directory Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant