cnlmka.blogg.se

Pug template browser
Pug template browser









pug template browser

Ok, so we have now our HTML code written in a very neat way, easy to understand but let’s extend it and start adding our normal classes and data attributes. The third one and one of the most common is simply writing the text after the HTML tag. The second way by placing a dot in the html tag and indenting the text below (with no |). As you may been noticing, the text can be written in our html tags in three ways, first putting the indented text below the tag with a pipe | before it. This simple command will create the corresponding HTML file next to the Pug one. 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: html head title This is my first Pug file body header p My soon to be menu section p This is a post about Pug template engine, enjoy it! footer cool footer with lots of copyrights pug extension, you don’t need to type the angle brackets and because of the indentation you can also ignore the closing tags.

pug template browser

As I mentioned earlier, Pug files use the. In this article I’ll show you the core features of Pug, to start let’s create our first file. Note: You need to have installed NodeJS in order to run npm commands from the terminal. Like most tools nowadays, Pug is a node package that can easily be installed on your system using the following npm command: Once you start using it, it’ll become an indispensable tool for you. When using modern CSS frameworks like Bootstrap and Foundation, most of the development becomes entirely about producing HTML, which brings out the power of Pug. It provides the ability to write dynamic and reusable HTML documents, its an open source HTML templating language for Node.js (server-side JavaScript), totally free to use and provides fast, easy, and fun HTML. Just like SASS, Pug is a prepocessor and, as such it helps you accomplishing tasks like wrapping away repetitive work by providing features not available in plain HTML. Simply put, Pug is a clean, white space/indentation sensitive syntax for writing html. Well with Pug, formerly known as “Jade” (a registered trademark, and as a result a rename was needed) it’s a high performance and feature-rich templating engine that’s easy to achieve. Clean and organize HTML, that’s what we as Front-end Developers always aim for.











Pug template browser