I'am using Metalsmith with Nunjucks to create a static website.
I have no issue creating a blog-like website, meaning creating a layout in which I could wrap some markdown content, using the metalsmith-layout plugin.
But I would like to create some views that :
- use a layout (with front-matter or with an extends method)
- use some hand-made components / partials / macros
For instance, an index.njk :
{% extends "layouts/base.njk" %}
{% block content %}
Hello World!
{% include components/test1.njk %}
{% include components/test2.njk %}
{% include components/test3.njk %}
{% endblock %}
I tried to use the metalsmisth-in-place plugin with :
.use(inplace({
engineOptions: {
path: __dirname + '/src/templating'
}
})
but I have a an error : The Transform "nunjucks" does not support rendering synchronously
It seems that inplace() cannot render the include properly...
Any idea ?