Removed workaround for missing main.html in themes.

Related to #1168.
This commit is contained in:
Waylan Limberg
2017-03-16 13:59:49 -04:00
parent 6b1f014c2a
commit 74980574a9
2 changed files with 11 additions and 11 deletions

View File

@@ -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

View File

@@ -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)