mirror of
https://github.com/mkdocs/mkdocs.git
synced 2026-03-27 09:58:31 +07:00
@@ -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
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user