Skip to main content

Questions tagged [pug]

Pug (formerly known as Jade) is a robust, elegant and feature-rich template engine for Node.js.

pug
Filter by
Sorted by
Tagged with
0 votes
1 answer
19 views

Colon symbol in class names for tailwind break Pug files

I am creating a project in Vue where the HTML aspect of it is written in pug. When I add a tailwind class, (for example in this case I am trying to add the classes ) .w-16.md:w-32.lg:w-48 Since it is ...
Joao Moita's user avatar
-1 votes
0 answers
30 views

Who manages logins the API or the front end web app [duplicate]

I'm working in a team where I'm developing an ASP.NET Core 8.0 Web API for a multi tenant application that returns results from a SQL Server database, and someone else is developing a web portal that ...
Shmiel's user avatar
  • 1,241
0 votes
0 answers
23 views

How can I enable Intellisense support for .pug files in vscode?

My angular project use pug template, is there any way setup intellisense for pug template file? I had tried package pugjs-angular-language-service. But it didn't work, it will better if it has ...
Minh Đặng's user avatar
0 votes
2 answers
37 views

Pug can't read array, but only if iterating through it

I am working on a small Web-development project, express with pug as the view-engine, for my University-course. I wish to iterate through an array of Weather-stations, creating a route for every one, ...
Melontree productions's user avatar
1 vote
1 answer
42 views

How do I use a module rendered by the controller with a Jade/Pug template as an argument to an event handler in the Jade/Pug template

I have this module naija passed to a template from the controller like this: res.render('testing', {title:"filter setting page", nigeria:naija ...
Femi's user avatar
  • 21
0 votes
1 answer
19 views

I get null in req.body when submitting data through pug form

this is pug form which is sending data to the requested url form.form.form-user-data(action='/submit-user-data' method='POST') .form__group label.form__label(for='name') Name ...
harshit's user avatar
0 votes
0 answers
16 views

pug/uikit nav sidebar lost left padding after uikit upgrade

I forked from this https://github.com/chekromul/uikit-ecommerce-template to build a static github page. but after I upgrade uikit to latest version, the side navbar lost its left paddings. before I ...
bhw1899's user avatar
  • 87
3 votes
2 answers
69 views

What is the order loaders applying in Webpack?

I am trying to setup the loading of .pug files by Webpack depending on interim filename extension, herewith it should be default one. In my case, the files which names ends with .vue.pug must me ...
Takeshi Tokugawa YD's user avatar
1 vote
0 answers
21 views

How can I use the selected option value of a select element in Pug/Jade template

I have this select in Pug/Jade select.form-select.col-xs-12.col-sm-12(id='selState1', onClick='+setState(selState1.value)') option(value='selState1', name='selState1',id='selState1') ...
Femi's user avatar
  • 21
1 vote
0 answers
36 views

Render block content with pug doesn't work

I'm face off an issue with Pug engine template. I can't inject the content of a Pug file into my layout, nothing is render! I have a home.pug which extends layout.pug, these two files are in the same ...
EmmanuelL's user avatar
1 vote
0 answers
57 views

How to get the static folder using Pug with Vite (Vituum, vite-plugin-pug…)

I'm using Pug for the first time with Vite and the plugin @vituum/vite-plugin-pug. Here's the structure of my project: src js css static imgs image.jpg views pages index.pug I'd ...
Lucie Bachman's user avatar
1 vote
0 answers
29 views

Read JSON in Pug NodeJs

I am sending a variable in the rendering response of my index view on my website, this variable is a JSON, but I cannot read it in Pug. JSON: { "expirepass": false, "memberships&...
Francisco Castillo's user avatar
0 votes
0 answers
24 views

How to read a json with pug NodeJs?

I am sending from node to my pug template a json in the response like this: res.render("memberships", { title: "DashRoc - Membresías", settings: JSON.parse(req.session....
Francisco Castillo's user avatar
0 votes
1 answer
159 views

Vuetify v-menu color

I am trying to change the color of the dropdown background of a v-menu. Right now it is just white then in dark mode it is that dark gray. I have tried the css override using this: .v-menu__content {...
VVaFF's user avatar
  • 13
0 votes
1 answer
25 views

Is this a pug template bug or my misunderstanding of the grammar?

I have the following code: - var a = 5; - var b = 3; script if (a === 5) if (b === 2) . var x = true; include script.js I want to include the script.js file when a == 5 and if b === ...
AGamePlayer's user avatar
  • 7,606
0 votes
0 answers
15 views

Array send by post form always received as string with first element only in Node js Express with pug

enter image description here { name: 'THERAPY 1', testsuites: '65e93cc4950e6a858809348f', description: 'UPDATED The pump software shall provide the Maximum Bolus Value therapy setting value ...
Kartik Aiyar's user avatar
1 vote
1 answer
80 views

Can't escape characters in pug/jade

I'm trying to escape special characters in pug/jade but it keeps giving me errors. I tried !{}, #[] and #[!] but non of these options allow me to use "(" character. p. !{(} Edit !{>} ...
bye-csavier's user avatar
0 votes
0 answers
30 views

how to make html div displays as 3 Column in pug

i want to display .course-item as 3 Column the .course-item in inside foreach which gets data from data base to create .course-item div but it all displays as one Column.. how can i fix it this is my ...
Rami's user avatar
  • 1
0 votes
1 answer
24 views

the gulp-pug doesn't work and say unexpected token "indent"

the gulp-pug doesn't work and say unexpected token "indent" see the images below gulp code and nodejs command prompt index.pug and nodejs command prompt package.json and nodejs command ...
M39ob Elzero's user avatar
0 votes
0 answers
45 views

How do I add structured data json script to Pug JS

I am trying to add in a script of json that is structured data for SEO into my Pug JS file. I am doing it the same way I do JavaScript with type="text/javascript", but it does not compile ...
Justin's user avatar
  • 556
0 votes
1 answer
25 views

A GET request is being fired off instead of the POST Request I've explicitly mentioned in axios

This is my login.js file which is responsible for client-side logging in functionality. My backend code is working fine as evident when I hit the api endpoint in postman and get my jwt successfully. ...
Anish Jha's user avatar
1 vote
1 answer
33 views

Express using default error handling page instead of view?

I'm following this MDN Express tutorial on creating a "Local Library" app, that uses Pug (Jade) as its templating engine. In this part of the tutorial, it details creating a controller for ...
mehkij's user avatar
  • 27
0 votes
0 answers
37 views

Mongoose data not showing on the web page as expected

I am creating a web app for keeping notes using mongodb, node.js, express and pug. When I load the home page the notes are arranged in order of date created. When I click the button to arrange the ...
AllThingsShiny's user avatar
0 votes
0 answers
49 views

How to add custom arabic font for pdf in pug file in node js project

I am using wkhtmltopdf libarary to convert pug file to PDF and in pug file I have text in arabic and english but I want specific font for arabic text to show in PDF file I tried it but it is giving ...
Sohaib Ul Hassan's user avatar
0 votes
0 answers
52 views

Linting for Pug and SASS inside Svelte files

My current setup is SvelteKit with preprocessors (TypeScript, Pug & SASS). I already have eslint, pug-lint & stylelint in place, but I can't make pug-lint and stylelint work inside .svelte ...
CRIS's user avatar
  • 345
-3 votes
1 answer
63 views

I am building an app where I want the admin to update any user who are displayed in the admin panel

I am a beginner and got stuck in this problem. I am building an app where I want the admin to update any user who are displayed in the admin panel by clicking on the update button at the bottom of the ...
Siraj Saifi's user avatar
0 votes
1 answer
77 views

Unable to access a property of an object using Mongoose

Sample data: { "_id": "ObjectId_for_Site1", "name": "Site 1", "address": "123 Reeganangam", "manager": { "_id&...
Ashok Kumar Maharajan's user avatar
0 votes
1 answer
35 views

pug how to set dynamic src

script. let thisfilefullname = document.URL.substring(document.URL.lastIndexOf('/') + 1, document.URL.lastIndexOf('.')); let imgurl = './img'; if(thisfilefullname.indexOf('localhost') == -1 &...
arachacha's user avatar
0 votes
1 answer
58 views

How to pass a HTML element as an argument to a pug mixin

I'd like to pass HTML through to my mixin. Something like this: mixin complexElement .container block header block content p This is some other content in the container. ...
mic's user avatar
  • 4,435
0 votes
2 answers
52 views

How to make three texts position on top of each slots respectively?

I am developing a simple random name picker website and I would like to know how to make three texts positioned on top of each slot and aligned center in each slot simultaneously. The current image of ...
loupdaniel's user avatar
0 votes
1 answer
84 views

express locallibrary tutorial author names missing from book list

I'm trying to build some knowledge in back end development (because I need it!) after spending a few years on front end, and after a short intro' into Basic Node and Express from the fantastic ...
Fishbite's user avatar
  • 192
0 votes
0 answers
231 views

How to integrate Vite into an existing old express app with pug templates

I have an old code that uses Express and renders HTML with pug. It uses plain js files and imports them like: script(type='text/javascript' src='js/test.js') They use jquery all around those js files. ...
H3lltronik's user avatar
0 votes
0 answers
38 views

Cant use pug module with parcel?

I am trying to rendering the content with the pug template but I cant import the pug modules into this file, i'm using parcel to bundle all the js file also. Here is the code: import html from ".....
NtotheKtotheL's user avatar
2 votes
1 answer
126 views

How can you implement new @for @if syntax introduced in Angular 17 in PUG?

I have been using PUG in my Angular application and I like the new syntax introduced in Angular 17 regarding @for and @if, replacing *ngFor and *ngIf. I wasn't sure how to implement this via PUG. ...
Jason's user avatar
  • 907
0 votes
1 answer
87 views

How do I host a website that contains PUG templates in a sub-folder instead of an index.html file in the root directory of the project folder?

I want to host my website for free but my files are in PUG and not HTML. From what I know, I need to have an index.html file that too in the root directory to be able to host the website since that ...
Arpita's user avatar
  • 1
0 votes
0 answers
37 views

Rendering a new pug template fails in ExpressJS

I'm making a sort of basic search engine and I have 2 pug template files called index.pug (the default search page) and search.pug (search results page) and an expressjs file called app.js that ...
Edward's user avatar
  • 1
0 votes
1 answer
102 views

Pug template won't render after redirecting to new url

Whenever I attempt to redirect to a new url with query params and then try to render it after, it doesn't want to render. If i take the additional query params off, the page will render just fine. ...
Priest's user avatar
  • 1
0 votes
0 answers
100 views

Pug add scripts from includes before the closing body tag

I have some pug templates, which use the include functionality. For example I have a index.pug and a detail.pug, which act as the parent layouts. body | I am the index.pug include my_partial | ...
Zeus's user avatar
  • 856
0 votes
1 answer
66 views

Cannot see anything in the console when trying to debug a login function

I am using Node.js with Express as well as Pug templates. I have a login function that is not working. I am trying to debug the code by logging the credentials (email and password) to the console. But ...
Leon's user avatar
  • 3
0 votes
0 answers
21 views

Why pug is not rendering?

these is snip shoot of the root route As you can see from the image, when ever I try to access the root which is "localhost:3000/" is not displaying anything. I don't see any errors what's ...
Filmon Tewelde's user avatar
0 votes
0 answers
46 views

How do I create an Angular Project using the CLI that uses Pug3?

I created a project using the following... ng new my-app cd my-app npx ng add ng-cli-pug-loader But I get .../my-app on branch main > npx ng add ng-cli-pug-loader npm WARN cli npm v10.2.3 does not ...
Jackie's user avatar
  • 23.1k
0 votes
0 answers
27 views

pass form value in PUG as a paramater in onclick function

I am trying to pass a value from a form to use as a parameter in a function in a onclick button. But im not sure how to get the value. This hardcoded example works: button.btn.btn-glider(onclick=...
user6086008's user avatar
0 votes
1 answer
31 views

PhpStorm navigate to style in PUG

In my project I use PUG and SCSS. When clicking a class name in PUG file I expect PhpStorm navigate me to appropriate style definition in a SCSS file. For example, in code p.text-white-75.mb-4 ...
Alexey's user avatar
  • 3,182
0 votes
0 answers
28 views

Nodejs pug form button not redirect and submit

When I fill in the information in the form in the add-product.pug file, the information should appear as a card on the home page and should be returned to the "/" directory as a redirect, ...
emir's user avatar
  • 1
0 votes
1 answer
45 views

What is wrong with the href in the pug?

/users/mihir/users/[object%20Object]/file.txt I have the following pug file and JS code to render the pug page. I have links for the directories and files in the path filepath, for which I am adding &...
Mihir Mutyampeta's user avatar
0 votes
1 answer
36 views

How to access a Render variable from the client (NODEJS + PUG)

exports.nuevoproyectoPST= async (req, res)=>{ const proyectos = await Proyectos.findAll(); //console.log(req.body); const {nombre} = req.body; let errores=[]; if (!nombre){ ...
Fabian Barua's user avatar
0 votes
1 answer
74 views

Using Object.assign() or spread ... operator in pug template

I have a 2 Pug files. The first define config object (base.pug) object like below const config = { name: 'abc', age: 25} The other Pug template (main.pug) which includes base.pug and wants to ...
Tanmayee 's user avatar
0 votes
1 answer
49 views

How to remove the / at the end of my url with 11ty

I'm using vite, 11ty and pug to create a website and I'd like to have no / at the end of my url. I tried to do it for example with About page but it didn't work. --- permalink: | | "/About"...
Nico's user avatar
  • 1
0 votes
1 answer
539 views

How use nice-select2?

Link to the plugin https://github.com/bluzky/nice-select2/tree/master I can't connect nice-select 2, I added css and js files from the dist folder to my project, connected them and wrote a line from ...
titsilia's user avatar
2 votes
3 answers
356 views

Cannot read properties of null (reading 'name')

I am following The Odin's project local library tutorial (Express app). Here is my code (only relevant parts): in routes/catalog.js I have this router.get("/books", book_controller.book_list)...
Piotrek940's user avatar

1
2 3 4 5
128