Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
  • 12:56
    Travis pugjs/pug#3228 broken (2159)
  • 12:54
    dartess opened #3228
  • Apr 03 15:20
    31453 commented #3204
  • Apr 02 22:46
    DrEsteban commented #3225
  • Apr 02 05:21
    ORESoftware edited #3227
  • Apr 02 05:21
    ORESoftware edited #3227
  • Apr 02 05:15
    ORESoftware edited #3227
  • Apr 02 05:14
    ORESoftware edited #3227
  • Apr 02 05:13
    ORESoftware edited #3227
  • Apr 02 05:12
    ORESoftware opened #3227
  • Apr 02 04:59
    ORESoftware commented #2292
  • Apr 01 14:30
    stefanfrede opened #3226
  • Mar 31 17:42
    andreubotella commented #3225
  • Mar 29 23:13
    samuray90 commented #681
  • Mar 29 23:12
    samuray90 commented #681
  • Mar 29 04:16
    jdneo opened #3225
  • Mar 28 03:00
    nmggithub commented #3179
  • Mar 26 14:38
    Volper212 commented #3222
  • Mar 26 09:25
    jerryc127 opened #3224
  • Mar 22 13:44
    papandreou commented #3189
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.
Manjeet Verma
Hi, could anyone help with this error. "Error: Failed to lookup view "index" in views directory "views"
I have deployed a Express API, which is in typescript and using serverless framework.
Shang Heng Wei
Hi pug experts, I tried to call pug.compile('extends /extends/template.pug\n\nblock campaign_title\n...'). How do I include the referenced extend file or load extend content in compile call? Thanks!