Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion readthedocs/doc_builder/backends/mkdocs.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from readthedocs.doc_builder.base import BaseBuilder
from readthedocs.projects.constants import MKDOCS
from readthedocs.projects.constants import MKDOCS_HTML
from readthedocs.projects.exceptions import UserFileNotFound


log = structlog.get_logger(__name__)
Expand Down Expand Up @@ -52,7 +53,12 @@ def get_final_doctype(self):

https://www.mkdocs.org/user-guide/configuration/#use_directory_urls
"""

# Check if the mkdocs.yml file exists before trying to open it.
if not os.path.exists(self.yaml_file):
raise UserFileNotFound(
"MkDocs configuration file is missing. "
"A configuration file named `mkdocs.yml` was not found in your repository."
)
# TODO: we should eventually remove this method completely and stop
# relying on "loading the `mkdocs.yml` file in a safe way just to know
# if it's a MKDOCS or MKDOCS_HTML documentation type".
Expand Down