

The website and documentation for Pug are still being updated, but if you are new to Pug, you should get started with the new syntax and install the Pug package on npm. Such differences are documented at #2305. Now that we have our index.pug template In order to compile it to HTML we need to open the terminal and navigate to the folder containing our file and run the command: pug index.pug This simple command will create the corresponding HTML file next to the Pug one. Currently, Pug 2.0.0 is still under beta stage, and there are several syntactic differences we have deprecated and removed.

Therefore, upgrading from Jade to Pug will be the same process as upgrading any other package with a major version bump. Remember to use save in command to update. To install Pug templating engine, execute the following command: npm install -save pug. It supports interpolation, filters and including other pages. It supports template inheritance, conditions and many other attributes making Pug easy to maintain. We have then made it so that this new major version bump will coincide with the rename to Pug. To avoid such issues, Pug engine will help us. If your package or app currently uses jade, don't worry: we have secured permissions to continue to occupy that package name, although all new versions will be released under pug.īefore the renaming, we had already begun working on an incompatible Jade 2.0.0. The next major version will carry "pug" as the package name. When your JavaScript functions have syntax er. templates/helloWorld.pug / doctype html html (lang'en') head title My Awesome Website body ul. After some discussion among the maintainers, "Pug" has been chosen as the new name for this project. There are many issues with adding JavaScipt to Pug templates including: PugJS throws exceptions on many JavaScript functions that are perfectly valid. Rendering Templates without Data Let’s start with a simple Pug template that consists of no data/locals: /. This project was formerly known as "Jade." However, it has been revealed to us that "Jade" is a registered trademark, and as a result a rename is needed. For bug reports,įeature requests and questions, open an issue. Pug is a high performance template engine heavily influenced by HamlĪnd implemented with JavaScript for Node.js and browsers.
