Pug Template Engine
pugjs.org
4
Leaving SiteNav
External Link Disclaimer
You are about to visit pugjs.org. This website is not operated by us. We are not responsible for its content or privacy practices.
About this website
Pug is a high performance template engine for Node.js that compiles to clean HTML markup using a terse, whitespace sensitive syntax that eliminates closing tags, angle brackets, and reduces boilerplate dramatically. Formerly known as Jade, the project was renamed in 2016 due to trademark concerns and is now maintained by the community under the MIT license with over 22,000 GitHub stars. The syntax relies entirely on indentation for nesting elements, making templates visually cleaner and significantly shorter than equivalent HTML. Key features include template inheritance through extends and block keywords for layout composition, mixins for reusable template fragments with parameter support, includes for partial template embedding, conditionals with if, else if, else, and unless, iteration with each and while loops, case statements, and inline JavaScript expressions within attributes and text. Variables can be interpolated using hash brace syntax, and unescaped HTML can be output safely. The engine supports filters for processing content with other languages like Markdown, CoffeeScript, or LESS, and provides built-in caching of compiled templates. Pug integrates natively with Express.js, Koa, and other Node.js frameworks. The CLI tool compiles templates to client-side JavaScript functions for browser rendering. Version 3.0 improved performance with a faster compiler and added strict mode support.
Statistics
4
Views
0
Clicks
0
Like
0
Dislike