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

Problem with macro usage in themes #192

Closed
verpeteren opened this issue Dec 4, 2017 · 2 comments
Closed

Problem with macro usage in themes #192

verpeteren opened this issue Dec 4, 2017 · 2 comments

Comments

@verpeteren
Copy link
Contributor

I have encountered the following situation while using a theme with macro's.

File: ./theme/something/template/index.html

{% import "macros.html" as macros %}
<!-- html code goes here, the details of the macro is not important -->

File: ./theme/something/template/macro.html

<!-- macro code goes here, the details of the macro is not important -->
$ gutenberg build
Building site...
-> Creating 5 pages (1 orphan) and 1 sections
Failed to build the site
Error: Failed to render section ''
Reason: Failed to render 'something/templates/index.html'
Reason: Template 'macros.html' not found

When I create empty file directly in the templates folder:

$ touch templates/macros.html
$ gutenberg build
Building site...
-> Creating 5 pages (1 orphan) and 1 sections
Failed to build the site
Error: Failed to render section ''
Reason: Failed to render 'something/templates/index.html'
Reason: Template 'macros.html' not found

However, It seems to work when I duplicate the file directly into the templates directories:

$ cp themes/something/templates/macros.html  templates/macros.html
$ gutenberg build
Building site...
-> Creating 5 pages (1 orphan) and 1 sections
Done in 50ms.

This is a work around, but I would like to distribute the macros together with the theme.
What am I doing wrong or what can I do to solve this problem?

@Keats
Copy link
Collaborator

Keats commented Dec 4, 2017 via email

@verpeteren
Copy link
Contributor Author

Indeed, it is working fine in the next branch.

My apologies: somehow I overlooked these two issues:

[X] Keats/tera#235
[X] #185

I'll close this issue. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants