Configuration

The default settings generate the most commonly-used URL pattern: if you have a resource at _static/js/logic.js and you generate a 404 page with the default settings, the URL for that resource will be /en/latest/_static/js/logic.js.

For other use cases, you can customize these configuration options in your conf.py file:

notfound_template

Template used to render the 404.html generated by this extension.

Default: 'page.html'

Type: string

notfound_context

Context passed to the template defined by notfound_template.

Default: {'title': 'Page not found', 'body': '<h1>Page not found</h1>\n\nThanks for trying.'}

Type: dict

Notes: If you prefer, you can create a file called 404.rst and use reStructuredText to create the context of your 404.html page.

notfound_pagename

Page name generated by the extension.

Default: '404'

Type: string

notfound_default_language

Language used as default to generate all links to the resources.

Default: 'en'

Type: string

Notes: All links generated will have this prefix (e.g. /en/). This setting works with notfound_default_version to create a prefix for all URLs.

notfound_default_version

Version used as default to generate all links to the resources.

Default: 'latest'

Type: string

Notes: All links generated will have this prefix (e.g. /latest/). This setting works with notfound_default_language to create a prefix for all URLs.

notfound_no_urls_prefix

URL prefixes skipped or included.

Default: False.

Type: bool

Notes: If this option is set to True, the extension omits any prefix values from the URLs, including explicit values for notfound_default_language and notfound_default_version.