Closed jvolker closed 8 years ago
As a workaround I'm now doing the following:
var nunjucks = require('nunjucks');
nunjucks.configure('./template', {
watch: true,
noCache : true
});
.use(layouts({
engine: 'nunjucks',
requires: {
"nunjucks" : nunjucks
},
directory: './template/',
_partials: 'partials/',
})
I can then use includes like this:
{% include _partials + "head.njk" %}
I tried passing cache: false in the metalsmith-layouts configuration. But it does not have any effect.
That could be. Whether passing cache: false
does anything is determined by consolidate. It handles the caching, and might not clear the cache for nunjucks templates, see here. I'd suggest you to check there, as we're dependent on the way consolidate handles this.
Let me know if anything related to layouts pops up.
I'm trying to use
metalsmith-layouts
withmetalsmith-watch
and watch the source and template directories.Whenever I change my main template file
home.njk
the browser refreshes satisfyingly.However I'm also using Nunjucks'
include
tag to pull in template partials. Nunjucks by default caches files being included. Whenever I change one of these files the change is not visible in the browser, even after a refresh. When I run the whole build script again, the change is visible.I tried passing
cache: false
in themetalsmith-layouts
configuration. But it does not have any effect.Thanks!