Questions tagged [pugjs]

pugjs is the Github organization which creates the "Pug" (previously known as "Jade") Node.js templating library.

Organization link: https://github.com/pugjs

79 questions
4
votes
5 answers

Workaround to dynamic includes in Pug/Jade

I understand that Pug does not support dynamic includes or extends in templates. Ie extend path/to/template works but not extend #{dynamic_path_to_template} Is there a workaround (however convoluted) that will allow the same goal of modifying…
takinola
  • 1,643
  • 1
  • 12
  • 23
4
votes
2 answers

Jade like syntax highlighting of .pug files Visual Studio 2015

This maybe a really silly question, but I've can't find any option to make it work. Following the recent change of the npm package name from jade to pug, i've gone around and changed all the .jade files in my projects to .pug - as the package…
Peter Coghill
  • 381
  • 2
  • 13
4
votes
2 answers

Including pug file causes error but jade works fine

Running into a weird issue here. I have a pretty basic jade/pug include going on here: extends base.pug block vars - var title = 'Home' block body header include ./includes/header.pug A quick note, just using extends base (without…
Omar Mir
  • 1,500
  • 1
  • 19
  • 39
3
votes
1 answer

How to render pugjs on electron?

I am trying to use pug on electron. I have a question my second .pug file is not rendered correctly, it just output the pug code itself. First I have this main pug file that was loaded by the main.js doctype html(lang='en') head …
zer09
  • 1,507
  • 2
  • 28
  • 48
3
votes
2 answers

How to inject a value inside a string in pug

Hello guys I am trying to inject a value inside a pug html attribute. I can not seem to find any documentation on how to do this. Here's my code input(type='hidden', name='country', value='#{val.snippet.id.videoId}') as you can imagine…
Shadid
  • 4,133
  • 9
  • 30
  • 53
2
votes
3 answers

Is there a way to use pugjs in svelte components?

I'm trying to rewrite my app made with pugjs and express in sveltejs. I really like to write html in pugjs. I was wondering if there is anyway I can use pugjs in svelte components. I am assuming I may need to use svelte-loader and do some…
anoop chandran
  • 1,460
  • 5
  • 23
  • 42
2
votes
1 answer

Pug tag names with at-signs/asperands (@)

I use pug to write .json files (compiled with gulp, gulp-pug and gulp-xml2json). It works really well normally, but I can't figure out how to get it to handle the asperands (@) necessary for json-ld structured data. I've tried every type of…
Sean
  • 6,873
  • 4
  • 21
  • 46
2
votes
2 answers

Node how to run python script when clicking button using pug and express node website

I'm trying to run a python script using the webpage I created in pug, express in node. I'm more familar with python than node. Using the below how can I run the python script? I have python shell included but not sure how to run the python script…
Sam
  • 1,207
  • 4
  • 26
  • 50
2
votes
1 answer

Sort JSON object with pug

Currently I am using this code to Sort the data within nodejs code. const popularPlaces = await Places .find({location: "New York"}) .sort( { locationscore: -1 } ) The code above finds location New York and sorts popular places with higher…
floss
  • 2,603
  • 2
  • 20
  • 37
2
votes
2 answers

How to include a css file in pugjs template

I'm using pugjs for my project.I was unable to load a css file in the pug template. I'm using the following code index.pug link(rel="stylesheet", href="views/styles/products.css", type="text/css") This is my project structure
2
votes
1 answer

Store value in input (Node, Sequelize, Pug)

I have a question about a blogpost-app I'm trying to build with i.a. node.js, sequelize and pug. I am looping through an array with blogposts and I would like to create an input (which I later on am going to make hidden) with a value that comes from…
developer
  • 111
  • 2
  • 5
2
votes
2 answers

How can I do this in Jade (pug)?

I don't know how to put i and "Profile" in a. Please help me!
RockerFlower
  • 727
  • 2
  • 10
  • 28
2
votes
1 answer

Adding if/else statements to Pug (ex-Jade) mixins?

How can I add if/else statement to mixin for adding checked attribute to my first radio input? mixin tab-header(name, id) input(type='radio' name='tabs' id=id checked) label(for=id) name +tab-header('Monday',…
Entry Guy
  • 425
  • 1
  • 7
  • 18
2
votes
1 answer

Support For The Pug Template Engine In Intellij IDEA

With Jade transitioning to Pug, There currently isn't a Pug plugin. The problem is that our .jade file extension becomes .pug which isn't recognized by the IDE. How can we use pug with Intellij IDEA (or other Intellij IDEs)?
Dave
  • 2,126
  • 1
  • 15
  • 18
2
votes
1 answer

Warning: Unexpected block "content"

Even though I've got the blocks correctly addressed they aren't being brought into the layout page: //- layout.jade doctype html html head title My Page body block content //- Main content goes here //- index.jade extends…
user1775718
  • 1,499
  • 2
  • 19
  • 32