File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
readthedocs/doc_builder/backends Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 1414from readthedocs .doc_builder .base import BaseBuilder
1515from readthedocs .projects .constants import MKDOCS
1616from readthedocs .projects .constants import MKDOCS_HTML
17-
17+ from readthedocs . projects . exceptions import UserFileNotFound
1818
1919log = structlog .get_logger (__name__ )
2020
@@ -52,7 +52,12 @@ def get_final_doctype(self):
5252
5353 https://www.mkdocs.org/user-guide/configuration/#use_directory_urls
5454 """
55-
55+ # Check if the mkdocs.yml file exists before trying to open it.
56+ if not os .path .exists (self .yaml_file ):
57+ raise UserFileNotFound (
58+ "MkDocs configuration file is missing. "
59+ "A configuration file named `mkdocs.yml` was not found in your repository."
60+ )
5661 # TODO: we should eventually remove this method completely and stop
5762 # relying on "loading the `mkdocs.yml` file in a safe way just to know
5863 # if it's a MKDOCS or MKDOCS_HTML documentation type".
You can’t perform that action at this time.
0 commit comments