Skip to content

Tarik Billa

  • Web Development
    • html
    • vue.js
    • laravel
    • css
    • javascript
    • jquery
    • node.js
    • php
    • asp.net
  • Programming
    • python
    • java
    • c
    • c++
    • c#
  • git
  • android

nunjucks

Nunjucks: ‘if’ with multiple ‘and’ or ‘or’ condition

August 21, 2023 by Tarik

Answer: As we know Nunjucks is inspired by Jinja2 python’s template engine, the if statement is similar to it. // And Snippet {% if (VARIABLE > 10) and (VARIABLE < 20) %} // {% endif %} // Or Snippet {% if (VARIABLE == 10) or (VARIABLE == 20) %} // {% endif %} Thats it … Read more

Categories node.js Tags node.js, npm, nunjucks, template-engine, templates Leave a comment

Integrating Nunjucks with IntelliJ IDEA / Webstorm

May 31, 2023 by Tarik

Just found a solution. Configure a custom extension with Twig files. It’s a template engine with similar syntax (but for PHP). add Twig Support plugin if necessary Go to Settings -> Editor -> File Types and add find Twig Add the custom pattern *.njk. Now all *.njk files are parsed as Twig so in the … Read more

Categories intellij-idea Tags intellij-idea, nunjucks, syntax-highlighting, webstorm Leave a comment

Convert integer to string Jinja

November 14, 2022 by Tarik

I found the answer. Cast integer to string: myOldIntValue|string Cast string to integer: myOldStrValue|int

Categories python Tags jinja2, nunjucks, python Leave a comment

Tarik Billa

Software Engineer
tarikbilla@gmail.com
+8801884414000
  • Reuse a hash in YAMLApril 17, 2024
  • Dockerfile: how to redirect the output of a RUN command to a variable?April 16, 2024
  • How to cd to a directory with spaces in the directory name?April 16, 2024
  • Maximum MIME type length when storing the type in a databaseApril 16, 2024
  • What is the difference between Unit, Integration, Regression and Acceptance Testing?April 16, 2024
© 2026 Tarik Billa