New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build 404 pages from the theme if they exist #194

Merged
merged 3 commits into from Nov 11, 2014

Conversation

Projects
None yet
3 participants
@d0ugal
Member

d0ugal commented Nov 6, 2014

No description provided.

@d0ugal d0ugal added this to the 0.11.0 milestone Nov 6, 2014

Add a 404 page to the MkDocs theme.
This change involved breaking up the context generation to create a sub
context that can be used for rendering pages not based on a specific
Markdown file.
canonical_url = None
global_context = get_global_context(nav, config)
local_context = global_context.copy()

This comment has been minimized.

@tomchristie

tomchristie Nov 11, 2014

Contributor

Rather than nest these would it be clearer if code using them calls each separately and combines the two dicts?
Maybe cleaner to have that done at the top level, rather than nested in here?

This comment has been minimized.

@d0ugal

d0ugal Nov 11, 2014

Member

Good point, I nearly done this but then forgot.

def build_404(config, env, site_navigation):
try:
t404 = env.get_template('404.html')

This comment has been minimized.

@tomchristie

tomchristie Nov 11, 2014

Contributor

Can we just name this template maybe?

This comment has been minimized.

@d0ugal

d0ugal Nov 11, 2014

Member

Changed, yeah, that was ugly.

@d0ugal d0ugal force-pushed the d0ugal:404 branch from 4bb6baf to 7b070ba Nov 11, 2014

@jpadilla

This comment has been minimized.

jpadilla commented Nov 11, 2014

@d0ugal works and lgtm.

@d0ugal

This comment has been minimized.

Member

d0ugal commented Nov 11, 2014

Thanks! Are you happy with it now @tomchristie?

@tomchristie

This comment has been minimized.

Contributor

tomchristie commented Nov 11, 2014

Yup, fab!

d0ugal added a commit that referenced this pull request Nov 11, 2014

Merge pull request #194 from d0ugal/404
Build 404 pages from the theme if they exist

@d0ugal d0ugal merged commit 229f7ee into mkdocs:master Nov 11, 2014

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details

@d0ugal d0ugal deleted the d0ugal:404 branch Nov 11, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment