From 74980574a9de98d79b2bb4c19bb23cdb3ad003c3 Mon Sep 17 00:00:00 2001 From: Waylan Limberg Date: Thu, 16 Mar 2017 13:59:49 -0400 Subject: [PATCH] Removed workaround for missing `main.html` in themes. Related to #1168. --- docs/about/release-notes.md | 11 ++++++++++- mkdocs/commands/build.py | 11 +---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/about/release-notes.md b/docs/about/release-notes.md index 6c8d5d63..1ecb81da 100644 --- a/docs/about/release-notes.md +++ b/docs/about/release-notes.md @@ -25,7 +25,16 @@ The current and past members of the MkDocs team. ### Major Additions to Version 1.0.0 -#### Previously deprecated Template variables removed. (#874 & #1168) +#### Previously deprecated Template variables removed. (#1168) + +##### Page Template + +The primary entry point for page templates has been changed from `base.html` to +`main.html`. This allows `base.html` to continue to exist while allowing users +to override `main.html` and extend `base.html`. For version 0.16, `base.html` +continued to work if no `main.html` template existed, but it raised a +deprecation warning. In version 1.0, a build will fail if no `main.html` +template exists. ##### Page Context diff --git a/mkdocs/commands/build.py b/mkdocs/commands/build.py index c94bcac7..ef804e35 100644 --- a/mkdocs/commands/build.py +++ b/mkdocs/commands/build.py @@ -153,16 +153,7 @@ def _build_page(page, config, site_navigation, env, dirty=False): if 'template' in meta: template = env.get_template(meta['template'][0]) else: - try: - template = env.get_template('main.html') - except jinja2.TemplateNotFound: - # TODO: Remove this in version 1.0 - template = env.get_template('base.html') - log.warn( - "Your theme does not appear to contain a 'main.html' template. " - "The 'base.html' template was used instead, which is deprecated. " - "Update your theme so that the primary entry point is 'main.html'." - ) + template = env.get_template('main.html') # Render the template. output_content = template.render(context)