Skip to content

support for two layout.html templates #903

@shimizukawa

Description

@shimizukawa

ReadTheDocs use layout.html to add their logo, but this skips project's custom layout.html and AFAICS this can't be changed without changing Sphinx code. See:

readthedocs/readthedocs.org#152 (comment)

Sphinx uses magic ! to skip template path, so only sphinx templates are searched when extend-ed template is prefixed with !. I think that the simplest way to allow two custom templates would be to add another magic prefix, say ?, that would skip only the first template directory in the list. Just a few lines in sphinx.jinja2glue.BuiltinTemplateLoader.get_source():

if template.startswith('?'):
    loaders = loaders[1:]
    template = template[1:]

what do you think?


Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions