brunch / nunjucks-brunch

Adds nunjucks support to Brunch
8 stars 6 forks source link

parent templates aren't compiled when children change #2

Open Ramblurr opened 9 years ago

Ramblurr commented 9 years ago

If I have a template, index.html, consisting of:

{% extends "template-base.html" %}

{% block bodycontent %}
{% include "foo_bar.html" %}
{% endblock %}

When I edit foo_bar.html, I expect index.html to be recompiled as well, but currently this isn't happening.

PxlBuzzard commented 9 years ago

I agree this should be the case. I'm not sure when I can get around to tackling this myself; pull requests are appreciated.

PxlBuzzard commented 9 years ago

Check out the newly published 0.3.1. I think it may have fixed this issue, but I would like to hear from @Ramblurr before I close it.

roobyz commented 9 years ago

I can confirm that neither 0.3.1 nor 0.3.2 fix this issue. I'm having the same proglem as Ramblurr.

PxlBuzzard commented 9 years ago

Alright, I agree with both of you that this would be a great feature. However, I'm looking around at the other pre-compilers for brunch as well as the nunjucks docs and I can't find any examples of this in practice. I know that this has been implemented in plenty of other tools (Django and SASS come to mind), but I don't know the logistics of adding this into a brunch plugin.

thijsvandien commented 7 years ago

To resolve this, the best option would be to become a plugin for brunch-static.

html-koder-com commented 4 years ago

Quite old topic, but still valid :-)

In gulp I solved this problem by setting the gulp to watch changes in "partials" and "layouts" folders and after any change gulp forced to recompile all files in "pages" folder.

Is it possible to set the same approach in brunch-config.js?