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
Allow docs to be in the root directory #3519
base: master
Are you sure you want to change the base?
Conversation
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`.
My motivation for this is that the user will be informed about the setting and will take this opportunity to check which other files should perhaps be excluded as well. |
I think the site_dir message is good. I'm not sure I follow what use case you're protecting against to warn against the mkdocs.yml file inside of the docs dir. Previously mkdocs required the docs dir to be located in a child directory named 'docs', but since you can now specify the config from the command line, I don't believe this is the case any more? |
Well, do people want to publish mkdocs.yml online? Probably not? So how can it be a bad warning. And I am hoping that people will take this opportunity to also exclude all other kinds of files that may be in the root directory of their repository. |
Ah, ok. Makes sense then. |
Would you consider making it a warning instead of an error? |
Error is closer to the current behavior than no error, so it was the default choice. Currently I don't see strong arguments in either direction. It can always be changed to warning, and could even be changed now, sure. Do you have any use case in mind? |
Yeah, if you want to do something like #3526 so excluded docs aren't triggering the reload server but you want to have mkdocs.yml trigger it, you might want to not add it to |
Eh, nevermind. I think I found a clean way of handling that case. An error sounds fine to me. |
I didn't merge this because not sure if next maintainers will want to own this code. |
Who are the next maintainers? |
Right now, they are the people in the @mkdocs/core team who have the time and will to work on MkDocs :) As you know it, we're also trying to onboard more people. |
|
If the config file is inside docs_dir, you get this message:
If the site_dir is inside docs_dir, you get this message: