Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
  • Jan 16 20:25
    Hyubert opened #3207
  • Jan 15 14:10
    Shinigami92 opened #3206
  • Jan 14 13:13
    NicoBougrand opened #3205
  • Jan 14 11:29
    ForbesLindesay commented #3126
  • Jan 10 00:11
    kerimkaan edited #3204
  • Jan 09 23:55
    kerimkaan opened #3204
  • Jan 06 17:12
    acidjazz commented #1990
  • Jan 04 14:00
    ZaDarkSide commented #3130
  • Jan 04 13:55
    edoardoo commented #1990
  • Jan 03 17:53
    YasharF edited #3202
  • Jan 03 16:55
    zackschuster commented #3184
  • Jan 03 16:52
    zackschuster commented #3184
  • Jan 03 16:51
    zackschuster commented #3184
  • Jan 03 16:49
    zackschuster synchronize #3184
  • Jan 03 16:44
    Travis pugjs/pug#3184 errored (2137)
  • Jan 03 16:43
    zackschuster synchronize #3184
  • Jan 03 16:41
    Travis pugjs/pug#3184 errored (2136)
  • Jan 03 16:39
    zackschuster synchronize #3184
  • Jan 03 16:36
    Travis pugjs/pug#3184 errored (2135)
  • Jan 03 16:34
    zackschuster synchronize #3184
Ashraf Ahmed
Current output:
<h3 class="list-title">Title</h3>
<ul class="list">
    <li class="list-item"> Go to a(href="link.html") link </li>
sorry for the spam, but these are the details
thanks for your help :pray:
Raka Widhi Antoro


Does anyone know how to overcome this? I can't call multiple .pug files

Hey all
Mohamed Atef
How to make an anchor tag <a> in new line when he is nested a paragraph <p>

in Pug.js, How to make something like that:

<a href="#">This is an anchor in new line inside a div</a>
but not like that:

<div> <a href="#">This is an anchor not in new line inside a div</a></div>
how to make the anchor in new line?

Tim Martin
Is there a good practice for including a pug file of mixins for usage in a document? Perhaps simply using the include keyword?
Kevin Palatzky
Someone online?
Can Pug used as alternative for htmltidy2?
Star Light
htmltidy2 is a validation tool, pug is a generation tool. I don't think they are the same.
Mason Mackaman
is there a particular reason why an object syntax (like what is used for the style attribute) isn't used for data attributes?
Mason Mackaman
@t-mart I use include
Lucas Bersier

Hello. Is there a way to do interpolation with iteration as well?

- var list  = [{name: 'a', age: 20}, {name: 'b', age: 21}, {name: 'c', age: 30}]
  var people = [
  #{each person in list} // how?

My desired output would be

var people = [
 {name: 'a', age: 20}, {name: 'b', age: 21}, {name: 'c', age: 30}
Mason Mackaman
- var list = [{name: 'a', age: 20}, {name: 'b', age: 21}, {name: 'c', age: 30}]
    var people = #{JSON.stringify(list)};
Lucas Bersier
My structure is circular, so it's not letting me use JSON.stringify, is there a way to use an iteration loop
Lucas Bersier


  var people = #{list}

results in var people = [Object object, Object object, ...], so the data is there

Mason Mackaman
@bersLucas I don't think the solution you're looking for exists. I think you're just going to have to write a function that takes an object and stringifies it in a way that works for your object, then use interpolation with that function and the object
perhaps try removing the circular references, JSON.stringifying it, and adding them back with some more string
or, if you're just trying to pass the data along, ask yourself if you even need the circular bits at all
what do "globals" in the options object do?
nowhere described
Mason Mackaman
Add a list of global names to make accessible in templates
i dont see it anywhere as an example
yeah i can read english
example is to be found nowhere
Mason Mackaman
I've never used it, but my guess would be that {globals: ['variable']} would be the same as {variable}
tried it but no, and it doesnt make sense, because what would "variable" do?
i was thinking "location" (as in windows.location.href
globals from the window object? donno
this is a doc issue, totally unclear, i also checked the code, "globals" is used somehow
I created an issue
is this project maintained, there seem to be a shitload of issues
Jacob Bogers
Mi name es Renzo and I amworking in a proyect mvc c# with pug
but is not core
but my app itswork fine in localhost butwhen I deploy my app in a hosting I cant visualize me views ?
Hello, Bro and Sis. Looking guide: gulp pub install
Jae Hong Lee
Hi guys, I just installed pug and got warning that code-js version is deprecated. Is this known issue?
Hi,When I type sudo npm i -D gulp-pug in the terminal, it returns "ERR! TypeError: Cannot read property 'latest' of undefined". Where is the cause?
I also typed command sudo npm install pug-cli -g,
sudo npm install -g pug,
sudo npm install pug.
Levi Wheatcroft

Hey, when trying to use the &attributes syntax I'm getting an error:
Cannot read property 'indexOf' of undefined on line 1 at pug_attr (/mnt/c/Users/levi/git/envoy-ubu/node_modules/pug-runtime/index.js:141:25)

index.js:141 is here and pug_attrs is called from here

On line 141, I can't figure out how val could be undefined, if it were, then val == null on line 129 would be true so pug_attr would return ''.
Levi Wheatcroft
oh wait I figured it out...
so something like this:
render('input(name=name value=value)&attributes({ foo: 'bar' })', { name: 'example', value: undefined })
will throw this error.