From c99ea4e250379df3fc704ce1c917e4ce94d4ab3b Mon Sep 17 00:00:00 2001 From: Waylan Limberg Date: Wed, 11 Jul 2018 13:58:13 -0400 Subject: [PATCH] Missing theme config file raises an error. Previously a warning was raised and the build proceeded. --- docs/about/release-notes.md | 3 ++- mkdocs/theme.py | 4 +--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/about/release-notes.md b/docs/about/release-notes.md index 507db559..788b8958 100644 --- a/docs/about/release-notes.md +++ b/docs/about/release-notes.md @@ -229,7 +229,7 @@ authors should review how [search and themes] interact. [search config]: ../user-guide/configuration.md#search [search and themes]: ../user-guide/custom-themes.md#search_and_themes -#### `theme_dir` Configuration Option fully Deprecated. +#### `theme_dir` Configuration Option fully Deprecated As of version 0.17, the [custom_dir] option replaced the deprecated `theme_dir` option. If users had set the `theme_dir` option, MkDocs version 0.17 copied the @@ -238,6 +238,7 @@ value to the `theme.custom_dir` option and a warning was issued. As of version ### Other Changes and Additions to Version 1.0 +* A missing theme configuration file now raises an error. * Empty `extra_css` and `extra_javascript` settings no longer raise a warning. * Add highlight.js configuration settings to built-in themes (#1284). * Close search modal when result is selected (#1527). diff --git a/mkdocs/theme.py b/mkdocs/theme.py index 5f18c1cc..520f5d09 100644 --- a/mkdocs/theme.py +++ b/mkdocs/theme.py @@ -83,12 +83,10 @@ class Theme(object): theme_config = utils.yaml_load(f) except IOError as e: log.debug(e) - # TODO: Change this warning to an error in a future version - log.warning( + raise ValidationError( "The theme '{0}' does not appear to have a configuration file. " "Please upgrade to a current version of the theme.".format(name) ) - return log.debug("Loaded theme configuration for '%s' from '%s': %s", name, file_path, theme_config)