i'm using nunjucks (gulp) as templating language and i want to build a dynamic page template.  This is my Json:  "pages": [     {         uname: "Welcome",         title: "Page 1 Headline"     },     {         uname: "...
I have been using nunjucks for several months, and have found it to be a great templating engine. However, this morning I ran into an issue that seems simple, but I simply cannot figure it out. I am hoping that another set of eyes can help point to t...
I'm quite new to nunjucks and from what I have read this is not possible, but I was wondering if anyone had come up with a way of doing this.  I am basically looking to perform a for loop in a nunjucks template based on a value rather than an obj...
I have a comments AJAX call which returns data of the posted comment, I also have @mention functionality built in, the server side is processing the @mentions and doing a str_replace on the mentioned users replacing their names with an a tag within t...
I have a large form made of radio buttons that I would like to create dynamically with nunjucks.   I have a json file with data to populate each html form input group with variables. The html consists of two radio inputs per group.   I can retrieve t...
I'm using Mozilla Nunjucks templating system for a static website which has multiple pages. For some purpose, I want to add a class to body tag for each different page  About us page > <body class="about">  Home > <body cla...
I have folder structure as follows:  /app    |-routes.js /public     |-index.html server.js   Server.js looks like this:  var nunjucks = require('nunjucks'); var express        = require('express'); var app            = express(); nun...
How can I set a variable from a Nunjucks extension? For example, here is a template and an extension. The x variable should only be visible from within the sample block.  Template:  {% sample %} {{ x }} {% endsample %}   Extension:  function SampleEx...
So I've found this in the Nunjucks docs:   Function Calls  If you have passed a javascript method to your template, you can call it like normal.  {{ foo(1, 2, 3) }}   But I can't seem to make in work, I've tried putting my function on the...
I have a .njk file that I would like to populate with data from a JSON file.  Currently I am using Webpack.  Here is my JSON File:  {     "ranking": "Colors",     "description": "Here is a ranking of my favorite colors"...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.