Skip to content
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

Theme templates that use tera include need the included file in the site templates #208

Closed
verpeteren opened this issue Jan 11, 2018 · 1 comment

Comments

@verpeteren
Copy link
Contributor

I am creating a theme that uses a tera include on the 'next' branch. Although the included file is also in the theme template directory an error occurs.:

Error: Failed to render page '/path-to-site/content/page-that-uses-a-sometheme-template-with-include.md'
Reason: Failed to render 'sometheme/templates/page.html' (error happened in a parent template)
Reason: Template 'filethatneedstobeincluded.html' not found

It seems that this problem is behaving in the same way as with the allready solved macros

@Keats
Copy link
Collaborator

Keats commented Jan 11, 2018

I thought I mentioned it in the docs but I can't find it: include paths are not rewritten in themes so gutenberg will not find them and they will not work. The reason being that changing those paths would require parsing each template recursively looking for a Include node that can be present at any point in any node.
If someone wants to have a go at it, the changes should be in components/utils/src/templates.rs in rewrite_theme_paths.
Since the Tera version has changed, it should be done on the next branch

verpeteren added a commit to verpeteren/gutenberg that referenced this issue Jan 12, 2018
verpeteren added a commit to verpeteren/gutenberg-materialize that referenced this issue Jan 15, 2018
@Keats Keats closed this as completed in 3ffcfda Jan 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants