Closed elantion closed 4 years ago
Can you give an example of what you trying to achieve?
For example, I want to convert below template to html and I don't want to deal with variables.
<!doctype html>
<html lang="cn">
<head>
<title>{{ title }}</title>
</head>
<body>
{% block body %}{% endblock %}
</body>
</html>
expect
<!doctype html>
<html lang="cn">
<head>
<title>{{ title }}</title>
</head>
<body>
<div id="app"></div>
</body>
</html>
Looks like you want to wrap some parts of your template in {% raw %}...{% raw %}
, to avoid rendering of this part.
It's the only way to render only specific nodes.
<!doctype html>
<html lang="cn">
<head>
<title>{% raw %}{{ title }}{% endraw %}</title>
</head>
<body>
{% block body %}{% endblock %}
</body>
</html>
What problem did you trying to solve? May be there a easier way.
It seem like it works for me. but what I expecting was some kind of configuration to achieve this. Thanks all the same. Good day, mate.
I want to combine nunjunks with html-webpack-plugin. I don't want to parse all nodes but only 'extends', 'block', 'include'. Is there a way to achieve this? Thanks, good day.