Skip to content

Extending themes can fail in surprising way #937

@Keats

Description

@Keats

Original report: https://zola.discourse.group/t/scripts/304
Reproduction repo: https://github.com/johnhalbert/zola-scripts

In the reproduction repo, what happens is that it tries to render index.html, looks into templates/ and see nothing so it renders the one from the theme.
However, that index.html is extending the Ergo base.html and Zola does not look for a base.html in the templates folder.
This happens because the templates and themes templates are built in two separate instances and then merged and nothing is done to the themes template to rewrite their parent templates.

I think that rewrite_theme_paths should get the templates Tera instance so we can check if we have a template with the same path/name and not replace the tpl.parent to be the theme template if so. This means that the theme Tera instance will be invalid until it gets merged with the templates one but that's only for a few lines and should be fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions