Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
  • Oct 21 11:11
    Goddak commented #2209
  • Oct 20 21:39
    t-mart commented #2464
  • Oct 20 21:38
    t-mart commented #2464
  • Oct 20 21:32
    t-mart commented #2464
  • Oct 20 21:29
    t-mart commented #2464
  • Oct 20 21:28
    t-mart commented #2464
  • Oct 20 21:22
    t-mart commented #2464
  • Oct 20 21:18
    t-mart commented #2464
  • Oct 20 21:13
    t-mart commented #2464
  • Oct 20 07:51
    haziqfiqri opened #3191
  • Oct 19 19:53
    SerayaEryn closed #3114
  • Oct 19 19:53
    SerayaEryn closed #3109
  • Oct 19 17:40
    SerayaEryn closed #3105
  • Oct 19 17:39
    SerayaEryn closed #3101
  • Oct 19 17:35
    moatefdev opened #3190
  • Oct 18 14:43
    Travis YasharF/pug (master) passed (2)
  • Oct 18 14:41
    YasharF edited #3189
  • Oct 18 14:40
    YasharF synchronize #3189
  • Oct 18 14:33
    Travis pugjs/pug#3189 errored (2121)
  • Oct 18 14:31
    YasharF opened #3189
Hello, does anyone know if Pug is able to refresh page content with socket.io on("message") event?
I'm setting the template to render using img(id= "ItemPreview", src= message) in index.pug and calling res.render('index', { title: 'Hey', message: result}); each time an message occur but it isn't updating the img src
Hi everyone, I am using pug as my template engine. Would anyone know if it is possible to have a default block content?
Sarsa Murmu
See this pugjs/pug#1468
Do Anyone Know About what is pug_html here
pug is html for node.js right?
It’s an html templating language
Navdeep Singh
i am new to pug. want to understand what is it for. i know what nodejs do
how does node server side environment can be used with pug
You can make html templates and serve static pages based off of those templates
Navdeep Singh
but i suppose why would anyone store the templates at server side
nodejs is not suppose to serve that right?
this means nodejs +express+ pug + some react /angular/vue make the complete package
correct me if i am wrong?
i came here by viewing code https://github.com/openstack/keystone
this github has used pug, so want to understand how i can use templates. I am into Cloud native development. I develop in aws lambda(nodejs), i expose API with api gateway
and these api would then be consumed by react or angular build frontend
or android etc.
please help me how i can use pug and where?
You don’t need a JavaScript lib to be served with static content
Making it a small and fast delivery
Navdeep Singh
So no vue / react
Navdeep Singh
oh, ok. then let me explore what it can do
thanks codymikol
Arun Kumar
Can pug be used like the component based framworks.
Also I it possible to create a scoped Js within a template like other UI frameworks
Not easily
Jacob Hallgarth
How can I use SQL with pug?
Jacob Hallgarth
Can someone please show me how to use SQL in Pug? I've created the queries in my index.js file, but not sure on the concepts on using them. I know you can display the data like span= object.Object , but this is not working for me. I did a for loop to iterate through the data and create a list item for each one, but I cant find out how to get a singular value instead of all of them...
Hello everyone, I was wondering how to get my sql query data to populate my html page using pug. Any insight would be great
Jacob Hallgarth
@treydawson81_twitter you have to create the sql query in your node file, then do a for each loop in pug to access it
Jacob Hallgarth
You can see some examples here: https://github.com/spatrick195/house-project
Max Rumsey
Considering the size of pug, and all the packages used, do you guys have any tips for developing pug? I've considered using npm link to link the packages together in the GitHub repo, but that's quite tedious.
Ylber Xhambazi
I can't understand this problems how can you help me? "include sass and javascript compiler, we expect you to develop the page with SCSS and ES6, preferred with Node.JS and Pug (Jade) templating"
Ashraf Ahmed
Hi there, I need help with mixins and string interpolation
here's my mixin:
mixin list(title, list)
    h3(class="list-title") #{title}
        each item in list
            li(class="list-item")!= item.text
Here's how I call it:
    const firstList = [
            "text": "Go to a(href='link.html') link",

+list("Title", firstList)
Ashraf Ahmed
Expected output:
<h3 class="list-title">Title</h3>
<ul class="list">
    <li class="list-item">Go to <a href="link.html"> link </a></li>
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?