Skip to content

Tag: pug

Pug render 2 templates in the same row

Is there a way to render these 2 templates in one line in Pug? I have been trying with adding span or moving the code around but not able to fix it yet. This code renders but in 2 rows, I essentially want this code in one row. Any ideas are helpful! Thanks 🙂 Answer I actually figured this with

Randomly Populate table rows in Pug files

Until this morning, I did not know what Pug is. However, now, it’s being used in a theme that I am using for work. Ran into this situation. The current pug file looks like this. is there any way to fill up this data with javascript, using some random array. For instance, suppose I have an array like this. Later,

How to include image in email template using pug and img tag?

Whenever the email is sent to the user, the image isn’t loaded and the alt text appears. This is the img tag that appears in the inspector whenever i open the email in the browser. Here is the line of code within the codebase that contains the img tag I’m thinking that this has to do with sending the email

How to access the into PUG passed object inside of an inline script without converting

Is it possible to access the whole object, which is passed into PUG, inside of an inline script without converting it with !{JSON.stringify(object)}; Using !{JSON.stringify(events)}; converts existing date-objects to strings, which than needs to be converted back. Wanted behavior: Answer Is it possible to access the whole object, wich is passed into PUG, inside of an inline script without converting

Button inside jade table cell

I want to add a button to shown in each row of the table, But the button does not appear cant figure out why. I’m new to jade and node js Jade file Answer you are not indenting your th’s correctly (they need to be indented relative to the tr that they are in) and you need to include an

Pug file not loading CSS

I’ve got an express project set up. I’m using Pug as the view engine. I’ve got the following lines in my app.js, And I’ve got the following in my index.pug view, The CSS files are in the right folders (public/stylesheets), but when I load up the app, the view does not seem to load the CSS files. The full project

How to display an in Vue.js only if the image url exists?

I’m getting a bunch of tweets from the Twitter API. Some tweets have images attached to them, some don’t. Currently, I use this code to display the image of a tweet: The problem is that this only works if the tweet actually has at least one image. If it has no image, I get an exception because is undefined.

Pug – generating Select and Options

I am new to Pug and I am trying to generate a Select set of Options like this: However the result I get, in the rendered page, is an empty select input followed by the list of options as text Answer Indents the code