6,441 questions
0
votes
0
answers
40
views
Vite/Vituum Build Fails with Persistent "Error parsing body of the with expression" (Pug Indentation/Compatibility Issue)
I am working with a Pug/SCSS template using Vite and the Vituum plugin, and I am consistently hitting a build error that seems to be related to the Pug parser's handling of template logic.
Despite ...
0
votes
0
answers
34
views
“Cannot read properties of null (reading 'length')” and Pug not rendering (shows raw Pug text instead)
I’m using a Vite + Vituum + Pug + SCSS template (based on the teacher’s repository vite-pug-scss-template) for a web-technologies lab.
When I run npm run dev, the dev server starts, but:
The browser ...
1
vote
1
answer
57
views
JADE pug template engine nested layout
is there any way to have multiple nested layouts in JADE?
for example:
master.pug then master-spec.pug then homepage.pug
what I'm trying to achieve - is to add a canonical meta tag to each page in the ...
-2
votes
1
answer
83
views
pug template how to use a label of a hidden file input to upload file?
I use pug template with Node.JS. How can I use a label to hide file input control and use the label click to upload file? I have done the same thing using bootstrap but not sure about about to ...
0
votes
2
answers
73
views
Alias for pug mixin
Is it possible to create aliases for pug mixins? I have a library of generic mixins for a project, but then have another mixin that when I call it I want to modify the behavior of some of the generic ...
3
votes
1
answer
140
views
Cannot display image in email template created with pug which is sent with nodemailer
My server.js contains following code to serve the image on server
app.use(express.static('public'));
app.use('/images', express.static('images'));
All the images are stored in '/public/images/' dir ...
1
vote
2
answers
66
views
How to better append html response content to a Node.JS pug template?
My Node.JS app makes an external API call which returns markdown response. I then use https://github.com/showdownjs/showdown toconvert it to HTML and append it to a scrollable list in the following ...
1
vote
1
answer
68
views
How to post both text and image to backend with Node.JS PUG
I have the following PUG template:
extends layout
block append head
link(type='stylesheet', href="https://stackoverflow.com/stylesheets/mystyle.css", rel='stylesheet')
block layout-content
#chat-app
#chat.has-text-...
0
votes
1
answer
152
views
Refused to apply inline style because it violates the following Content Security Policy
I was trying to use inline styling, but suddenly the console is giving this error and ain't letting me do one important task.
each review in tour.reviews
.mc_reviews
...
1
vote
1
answer
64
views
Pug template not working with nuxt variables
I am trying to run a simple pug for loop inside of my nuxt app.
I installed https://www.npmjs.com/package/vue-pug-loader by running the commands, and the syntax seems to work:
<template lang="...
0
votes
1
answer
41
views
Method to Utilize NodeJS Array from Sequelize into the Script Tag of a Pug Template
So I am having an issue with figuring out how to get the variable that is passed from NodeJS into my Pug Template into a variable within the Pug Template's Script tag. The issue is that it is a ...
0
votes
1
answer
330
views
How do I get ESLint 9 to work with pug templates?
My stack consists of Pug templates, JS (Jquery), yaml and stylus files. I am struggling to get ESLint to work with Pug. I have installed the eslint-plugin-pug and added it to the plugins in the eslint ...
2
votes
2
answers
74
views
Express route fires a second time
I have a program which I have reduced to almost nothing, and still get the problem that, if I include a HTML5 Video construct, then the initial route gets called twice.
app.js
var express = require('...
1
vote
1
answer
28
views
pug creates newline character in mixin when using block keyword
This example
mixin article
div
if block
block
+article Test
When inspecting the code it looks like one space, but if we start editing the text node we will see this:
<div>Test
...
1
vote
0
answers
91
views
How can I use pug in angular esbuild, using @angular-builders/custom-esbuild
I am using angular 17, I use pug template, current, I use ng-cli-pug-loader to load pug.
I want to transfer to esbuild, so after researching I know that esbuild can config plugin. Can I use plugin to ...
-1
votes
2
answers
224
views
Can I use pug template with angular builder esbuild?
In angular 17, I am using "builder": "@angular-builders/custom-webpack:browser".
Now I want to use esbuild buider. But my project currently use pug template alter for html.
Can I ...
4
votes
1
answer
474
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 ...
0
votes
2
answers
59
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, ...
1
vote
1
answer
70
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
...
0
votes
1
answer
37
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
...
3
votes
2
answers
130
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 ...
1
vote
0
answers
37
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') ...
1
vote
0
answers
67
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 ...
1
vote
0
answers
357
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 ...
1
vote
0
answers
47
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&...
0
votes
0
answers
29
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....
0
votes
1
answer
731
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 {...
0
votes
1
answer
34
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 === ...
1
vote
1
answer
432
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 !{>} ...
0
votes
1
answer
36
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 ...
0
votes
1
answer
92
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 ...
0
votes
1
answer
43
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.
...
1
vote
1
answer
59
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 ...
1
vote
0
answers
79
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 ...
0
votes
1
answer
92
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&...
0
votes
1
answer
52
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 &...
0
votes
1
answer
224
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.
...
0
votes
2
answers
94
views
How to make three texts position on top of each slots respectively?
Description
I am developing a random name picker web app and I'd like to know how to make three texts positioned on top of each slot and aligned center in each slot simultaneously.
The current image ...
2
votes
1
answer
268
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.
...
0
votes
1
answer
144
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 ...
0
votes
1
answer
181
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.
...
0
votes
0
answers
212
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
| ...
0
votes
1
answer
108
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 ...
0
votes
1
answer
51
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
...
0
votes
1
answer
43
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, ...
0
votes
1
answer
51
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 &...
0
votes
1
answer
42
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){
...
0
votes
1
answer
121
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 ...
0
votes
1
answer
109
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"...
0
votes
1
answer
1k
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 ...