File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
readthedocs/doc_builder/backends Expand file tree Collapse file tree 1 file changed +7
-1
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+ from readthedocs .projects .exceptions import UserFileNotFound
1718
1819
1920log = structlog .get_logger (__name__ )
@@ -52,7 +53,12 @@ def get_final_doctype(self):
5253
5354 https://www.mkdocs.org/user-guide/configuration/#use_directory_urls
5455 """
55-
56+ # Check if the mkdocs.yml file exists before trying to open it.
57+ if not os .path .exists (self .yaml_file ):
58+ raise UserFileNotFound (
59+ "MkDocs configuration file is missing. "
60+ "A configuration file named `mkdocs.yml` was not found in your repository."
61+ )
5662 # TODO: we should eventually remove this method completely and stop
5763 # relying on "loading the `mkdocs.yml` file in a safe way just to know
5864 # if it's a MKDOCS or MKDOCS_HTML documentation type".
You can’t perform that action at this time.
0 commit comments