Questions tagged [pug]
Pug (formerly known as Jade) is a robust, elegant and feature-rich template engine for Node.js.
2,023
questions with no upvoted or accepted answers
8
votes
0
answers
852
views
Is there a way to pass variables into PugJS filters
Using Pug filters and the jsTransformer-handlebars module I'm trying to insert some handlebars code into a pug template that will make use of locals. However, since Pug renders filters at compile time,...
8
votes
1
answer
1k
views
Import CSV/JSON in jade
I am using jade as a template engine for a static website, so I am not using any express server.
I'd like to import a csv or json file to load the data in my template. It can very easily be done using ...
7
votes
2
answers
1k
views
Tailwind CSS Arbitrary Values Doesn't Work With Pug?
I have an issue when using Tailwind CSS v3.0.18 arbitrary values in pug files. I followed this answer but it doesn't solve the issue.
Here is my pug file:
.container.mx-auto.flex.items-center.space-x-...
6
votes
2
answers
789
views
Make jade compile to index.php instead of index.html
How can I make jade compile to index.php instead of index.html?
5
votes
3
answers
5k
views
How do I render a pug/jade template with React, Node and Webpack?
I have a React/Node/Express application, and I am using Webpack to build it.
Currently, the structure of the directory is as such:
node_modules
public
app
main.js
main.map.js
...
5
votes
1
answer
2k
views
Using a Jade mixin block as an attribute
Whilst developing a library of Jade templates it has become desirable to use a mixin's block to serve as an attribute value, simplifying the syntax for the end user.
The end user will have a choice ...
5
votes
2
answers
893
views
How to generate a pure JavaScript file with Jade
I know that Jade is for producing HTML instead of JavaScript, but for a project I'm working, it would be great, and a huge time saver, if I could do this without adding a pipe in every line:
| (...
5
votes
1
answer
730
views
Render single block in jade
I'm working with Node.js and express. Suppose I have a pair of jade files:
template.jade
html
body
block page-content
example.jade
extends template
block page-content
p
...
5
votes
1
answer
772
views
Assign content to multiple blocks inside a mixin which generates a nested HTML structure dynamically in Jade?
I want to create the following HTML structure
<div class="outerspace">
<div class="inner1"><p>Inner1 content</p></div>
<div class="inner2"><p>Inner2 ...
5
votes
1
answer
751
views
How do I import mixins using `pyjade` efficiently?
Referring to https://github.com/SyrusAkbary/pyjade/issues/27, it seems the jinja2 does not allow importing mixins from external files.
However, I got a helper.jade which has loads of mixins. If I ...
5
votes
1
answer
3k
views
Passport.js: accessing user when using backbone
I'm using passport.js in a node.js app to get OAuth working (awesome!), but now, I'm having problem with one thing.
I'm using backbone.js on client side, to create the views (I'm trying to create a ...
5
votes
1
answer
1k
views
AngularJS, ng-view + css3 keyframes with jade template - ng-cloak not working
I'm currently building off of this: https://github.com/btford/angular-express-blog bit of code, which uses nodeJS, Express, Jade and obviously AngularJS. I'm running the most current version of ...
4
votes
3
answers
3k
views
Tailwind PostCSS inject styles inline instead of generating a CSS file
I am using PUG + Tailwind + PostCSS for a static, single page HTML file which is generated using basic NPM scripts (shown below)
I would like the final HTML to have the tailwind styles inlined ...
4
votes
0
answers
577
views
How to render html with pug at runtime in a project served by gulp?
I am new to web development, and am using gulp for my project, which serves index.html page at build time.
I am using pug as a template for generating html.
gulfile.js
const bundler = () => {
...
4
votes
0
answers
367
views
Pass arbitrary SVG icon to Pug mixin without "block"
Targets
Message box must be the component with icon and arbitrary content, like paragraphs, lists, etc. The reason of 'without "block"' in the title of this question is block is being ...