Simplified Syntax
Pug offers a simplified and clean syntax compared to standard HTML, omitting the need for closing tags and reducing the repetitive structure, which makes it easier to write and read.
Code Reusability
Pug supports mixins and includes, which allow for the reuse of code snippets and components throughout the templates, promoting DRY (Don't Repeat Yourself) principles.
Logic in Templates
It provides the ability to incorporate JavaScript logic directly within the templates, allowing for dynamic content generation and more interactive pages.
Compatibility with Existing JavaScript
Pug integrates smoothly with Node.js and JavaScript applications, making it easy to use within popular frameworks like Express.
Efficient Compilation
Pug compiles templates into highly optimized JavaScript code, resulting in fast rendering performance in web applications.
Pug is a good choice for developers looking for a concise and expressive way to template their HTML, especially those who prioritize readability and maintainability in their codebase.
We have collected here some useful links to help you find out if Pug is good.
Check the traffic stats of Pug on SimilarWeb. The key metrics to look for are: monthly visits, average visit duration, pages per visit, and traffic by country. Moreoever, check the traffic sources. For example "Direct" traffic is a good sign.
Check the "Domain Rating" of Pug on Ahrefs. The domain rating is a measure of the strength of a website's backlink profile on a scale from 0 to 100. It shows the strength of Pug's backlink profile compared to the other websites. In most cases a domain rating of 60+ is considered good and 70+ is considered very good.
Check the "Domain Authority" of Pug on MOZ. A website's domain authority (DA) is a search engine ranking score that predicts how well a website will rank on search engine result pages (SERPs). It is based on a 100-point logarithmic scale, with higher scores corresponding to a greater likelihood of ranking. This is another useful metric to check if a website is good.
The latest comments about Pug on Reddit. This can help you find out how popualr the product is and what people think about it.
HTML is verbose. Writing nested structures by hand is tedious and error-prone. Pug (formerly Jade) solves this with a clean, indentation-based syntax:. - Source: dev.to / 7 months ago
For a more robust approach, we'd probably need to install a templating language of some kind, such as Twig, EJS, Handlebars, Pug or Mustache (this is not a complete list!). Reading the documentation for posthtml-modules, you'll notice it doesn't mention package.json or any of the approaches we've used in this guide. Instead, the examples are in JavaScript and we've advised to add this to our Node application. - Source: dev.to / over 1 year ago
If you have a bit of Nodejs SSR background, you would already be accustomed to templating libraries like Pug, Handlebars, EJS, etc. If youโre from a PHP background you would be familiar with the Blade templating engine. These templating libraries basically help you render dynamic data from the backend on the frontend. They also help you generate markup with loops based on conditions. - Source: dev.to / over 2 years ago
The right way to start is with HTML and motherfucking web site. https://motherfuckingwebsite.com/ Really. At this point this is what web sites should strive to be. Pug is a great way to write HTML by hand. I integrated it with GitHub Pages so pug sources get compiled to HTML and published when commits are pushed. Great experience. https://pugjs.org/ - Source: Hacker News / almost 3 years ago
To illustrate the process of migrating from Express to Fastify, we have prepared a demo application. This application utilizes Express, Mongoose, and Pug to create a URL Shortener app as follows:. - Source: dev.to / about 3 years ago
Disclaimer: The markup of CodePen examples is still in Pug. However, you can view it compiled as HTML by opening the code tab menu and selecting "View compiled HTML" (But, by the way, if you are not already familiar with Pug Templates, I strongly advise you to check them out). Source: about 3 years ago
I'm sorry about your doggie, but you have the wrong subreddit. The Pug template engine https://pugjs.org/ is discussed here exclusively. Dogs are not discussed here. Source: over 3 years ago
The pug support for my projects is the last step for final migration from VSCode to Helix - any suggestions as to what existing language can be used as a basis for adaptation? Source: over 3 years ago
If you want more, take a look on Marko, fresh, qwik or pug. Dind't tested yet but they look like same as Nunjucks. Source: over 3 years ago
I was the person who had to deal with the rename of Pug (formerly called Jade). It was super stressful but it did all turn out ok in the end. I hope the name change goes well for you. The thinking behind Pug was: it is short (especially good for a file extension), it is very easy to spell, and it was available on npm. Source: about 4 years ago
There were(and still are) tools that decreased code duplication. Tools like Pug and others are Javascript scripts that compile custom HTML syntax into standard HTML. With their help, a developer can create one component(e.g. a header with links) and put it on many pages without duplicating the component code. If I need to change the component style or structure, I alter the code in one place. - Source: dev.to / over 4 years ago
I'm late to the party but I absolutely hate HTML so I use something called pugjs, which let's you write html in a more programming friendly way IMO. Source: over 4 years ago
I suggest you to use a template engine like pug.js. Source: over 4 years ago
The third way and the least preferred way is server-side rendering with template engines like ejs, handlebars, pugjs etc... Here we don't create any REST API. We render different html pages for different http requests and use react to pre-render some parts of the page. This is not preferred way to connect React and Node because we don't get the power of reactive user experience. - Source: dev.to / over 4 years ago
Both web frameworks support a huge number of template engines right out of the box: Pug, Jade, Mustache, Handlebars, and many others. Let's take a look at the Pug engine to see how a template renders in Express works:. - Source: dev.to / almost 5 years ago
I found about IHP a while ago and it sounds exactly like what I've been looking for in a web framework: Beginner-friendly, stable, type-safe, functional. I got even more interested after I read your blog post on Auto Refresh[1], which sounds like it was heavily inspired by Phoenix's LiveView[2] (even though you don't mention it anywhere). Can you do a comparison between the two, in terms of how ergonomic... - Source: Hacker News / almost 5 years ago
The concept is pretty simple- wherever some data is not pre-defined, we use template values as placeholders; wait until a request is received along with the data; and then inject it into the page before sending to the client. There are template engines like EJS and Pug that ease our job to generate HTML via template pages. - Source: dev.to / almost 5 years ago
In this example we will use pug (formerly known as "Jade", and also originally created by TJ Holowaychuk) to define some templates that should be filled with the data needed in the email, and mjml to actually design the email content. - Source: dev.to / about 5 years ago
In this article, we are going to take a look at a CLI tool called svpug for generating Pug mixins from SVG files. Before diving into the main content let's some context first. - Source: dev.to / about 5 years ago
Pug is the template engine for our express app and body-parser is used to get the form-submitted values in our request body. - Source: dev.to / over 5 years ago
You can also have reusable UI components on the server side by using a more established and mature templating libraries like pug for Node. And I am quite sure that the templating libraries for other platforms like RAILS,Django also have the same or more advanced capabilities which will allow us to construct complex and dynamic HTML. - Source: dev.to / over 5 years ago
Do you know an article comparing Pug to other products?
Suggest a link to a post with product alternatives.
Is Pug good? This is an informative page that will help you find out. Moreover, you can review and discuss Pug here. The primary details have not been verified within the last quarter, and they might be outdated. If you think we are missing something, please use the means on this page to comment or suggest changes. All reviews and comments are highly encouranged and appreciated as they help everyone in the community to make an informed choice. Please always be kind and objective when evaluating a product and sharing your opinion.