Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 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
goldern
@goldern
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
runtzguy
@runtzguy
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
@sarsamurmu
See this pugjs/pug#1468
Do Anyone Know About what is pug_html here
adhidevara
@adhidevara
pug is html for node.js right?
codymikol
@codymikol
It’s an html templating language
Navdeep Singh
@nsingh308
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
codymikol
@codymikol
You can make html templates and serve static pages based off of those templates
Navdeep Singh
@nsingh308
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?
codymikol
@codymikol
No
You don’t need a JavaScript lib to be served with static content
Making it a small and fast delivery
Navdeep Singh
@nsingh308
ok
codymikol
@codymikol
So no vue / react
Navdeep Singh
@nsingh308
oh, ok. then let me explore what it can do
thanks codymikol
codymikol
@codymikol
Np
Arun Kumar
@arunkumar413
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
codymikol
@codymikol
Not easily
Jacob Hallgarth
@spatrick195
How can I use SQL with pug?
Jacob Hallgarth
@spatrick195
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...
21_guapo
@treydawson81_twitter
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
@spatrick195
@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
@spatrick195
You can see some examples here: https://github.com/spatrick195/house-project
Max Rumsey
@maxrumsey
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
@B8371
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
@Ashr4f
Hi there, I need help with mixins and string interpolation
here's my mixin:
mixin list(title, list)
    h3(class="list-title") #{title}
    ul(class="list")
        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
@Ashr4f
Expected output:
<h3 class="list-title">Title</h3>
<ul class="list">
    <li class="list-item">Go to <a href="link.html"> link </a></li>
</ul>
Current output:
<h3 class="list-title">Title</h3>
<ul class="list">
    <li class="list-item"> Go to a(href="link.html") link </li>
</ul>
sorry for the spam, but these are the details
thanks for your help :pray:
Raka Widhi Antoro
@RakaWA

res.render('layout');
res.render('body');
res.render('footer');

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

Tyler
@Tyler0722
Hey all
Mohamed Atef
@moatefdev
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:

<div>
<a href="#">This is an anchor in new line inside a div</a>
</div>
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
@t-mart
Is there a good practice for including a pug file of mixins for usage in a document? Perhaps simply using the include keyword?