An Introduction to #pug
▻https://hackernoon.com/an-introduction-to-pug-1dbe7cfcacd8?source=rss----3a8144eabfe3---4
Pug (formerly known as Jade) is a preprocessor which simplifies the task of writing #html. It also adds a ton of functionality, such as #javascript objects, conditionals, loops, mixins and templates. The syntax is arguably a lot cleaner to read and it can be a real time-saver when working with a lot of HTML (especially frameworks such as Bootstrap, Foundation, etc).Lets take a peek at some Pug syntax & compare it to regular HTML..// index.pugdoctype html html(lang=’en’) head title Pug demo body h1 Welcome to Pug Life div.container p I’m a p that needs to be contained!Note the use of indentation to nest our HTML as we require. And the lack of closing tags!And here’s the standard HTML output:// index.html<!DOCTYPE html> <html lang="en"> (...)