pug Questions

3

Solved

I want to load some Jade content into a certain div on button click. I have found how to do this with jQuery, there are several posts on it, and essentially what I want to do is $('#div').load('/so...
Vyatka asked 30/6, 2016 at 20:18

2

Solved

I have the following json object: var partners =[{ "name":"partnerx", "image": "imagex" }, { "name": "partnery", "image": "imagey" }] I want to put into a ul object using jade and I tried: ul#...
Omasum asked 19/6, 2014 at 21:48

6

Solved

I am still not that familiar with the Jade template engine. Is there a way to convert the new lines such as \n to br tags and at the same time keep the other content encoded? For example .replac...
Haddington asked 26/1, 2013 at 19:38

3

Solved

In my application, I need to provide an API (something like the Google Maps javascript API), through which I can send some custom javascript (with some session and request related information) as t...
Bougie asked 6/5, 2013 at 22:49

9

Solved

I am new to jade and stuck on this issue. I think I have tried everything from the StackOverflow posts and still at nothing. The things I have tried button(type='button' class=' c-btn-blue c-bt...
Blow asked 26/8, 2016 at 7:5

3

Solved

I am pretty new to jade and I have the following problem. Having this (simplified) mixin: mixin someMixin() .someClass block first .otherClass block second now I try to you this mixin mult...
Ergograph asked 8/9, 2015 at 11:43

2

Solved

I'm trying to show the value from #{product.name} in a textfield. This is my code, but it doesn't work label Name input(type='text', placeholder='Name', name='name' value='#{product.name}') This...
Estep asked 22/4, 2018 at 8:43

7

Solved

I have this jade file: !!! 5 html head title test include style(type='text/css') //- DOES NOT WORK! include test.css body //- works include test.css div //- works include test.css Th...
Trephine asked 15/5, 2012 at 6:54

6

Solved

I'm using Node+Express+Jade to render some webpages. On a form there are 2 checkboxes. When the form is submitted through POST, if the checkbox is checked, I get req.body.checkbox1 -> 'on', if i...
Hooghly asked 25/8, 2015 at 11:58

7

Solved

I'm currently using Jade on a new project. I want to render a page and check if a certain variable is available. app.js: app.get('/register', function(req, res){ res.render('register', { locals...
September asked 21/2, 2011 at 20:20

5

Solved

I using express and jade, but when I debug I doesn't want jade compress my html, are there any way to pass an option jade globally and make it does not compress html.
Saphena asked 3/11, 2011 at 8:9

6

Is it possible? If so, how? If its not, do I have to abandon pug if I need to write PHP in my documents? After searching around I didnt find anyone that has adressed this.
Bawl asked 3/2, 2017 at 11:40

8

Solved

I am wondering if there is an easy way to access Express.js' req or session variables from within a Jade template without passing it in through the normal response. Or is this the only way? res.r...
Fossilize asked 13/6, 2011 at 14:28

3

Solved

I've tried all the permutations I can think of but alas with no success. I am trying to set an id dynamically in a jade template. #{page.name}(data-role= 'page', data-theme= 'c', data-url='#{"#"+p...
Steddman asked 24/11, 2011 at 14:21

3

Solved

As described here: http://jade-lang.com/reference/, it is easy enough to either get the index or the key. But is there a way to get both? This: ul each val, index in {"day": "Wed", "link": "url"...
Misinterpret asked 27/9, 2013 at 13:51

5

Solved

I can't set a variable name in a class in jade: .flag_#{ session.locale } #{ session.locale } I have: <div class="flag_" >en</div> And I'd like to have <div class="flag_en" &g...
Elamite asked 2/12, 2012 at 11:33

4

Solved

in jade one can write: div.container and it compiles into: <div class="container"></div> But what if you have several classes like: <div class="span 4"><div> I have...
pug
Ramin asked 17/3, 2012 at 14:28

2

Solved

I am try to get this to work in jade template: html: <li><i class="icon-comment"></i> 5</li> jade: li:i.icon-comment 5 ofcource 5 now is nested under i tag rather the...
Connell asked 8/11, 2012 at 22:16

7

Solved

I have a row with a dynamic count of columns that is generated in JADE based on data fetched from the database. Items are image and the count of them can be 0 and can be a large number (max 100). ...
Tarpeia asked 26/8, 2014 at 7:44

5

Solved

Anyone having luck adding .pug to angular-cli? I tried to do npm install pug --save, but I don't know where to change the .pug rendering instead of .html. Link for the angular-cli is here Please...
Kelter asked 15/9, 2016 at 18:59

2

Solved

How do you block comment out code in the Pug templating engine? I know how to comment out a line: //-doesn't show but I don't want to have to write in full html comments like so: <!-- no s...
pug
Prior asked 10/12, 2013 at 11:14

4

Solved

I'm using Jade in my latest node.js app. I'd like to have a long block of text in a textarea by default. If I do something like this: textarea(id="theTextarea") it renders just fine: <texta...
Footprint asked 18/5, 2012 at 21:8

2

Solved

I am using NodeJS with Express and the PUG view engine. I am attempting to check if an array contains a certain string. I have tried the builtin javascript methods such as: array.includes(str) ar...
Palmary asked 22/3, 2018 at 15:46

1

Solved

There are many issues with adding JavaScipt to Pug templates including: PugJS throws exceptions on many JavaScript functions that are perfectly valid. When your JavaScript functions have syntax er...
Pediatrician asked 16/7, 2020 at 17:36

2

I am trying to take a variable I've sent to my Pug page from Node.js and place it inside a javascript variable inside of a pug script tag. (Sorry if that is confusing) My node.js code is as follows...
Polenta asked 19/9, 2016 at 13:13

© 2022 - 2024 — McMap. All rights reserved.