Using Jade instad of HTML

A way to write reusable HTML code

If you want to simultaneously:

this is easy to set up.

Strictly speaking, you don't use HTML, you use a templating language that is what HTML ought to be, and that compiles into HTML. There are a few of these; I recommend Jade. Ben and I just converted our HTM websites into Jade in half an hour and everything works perfectly. Now we can refactor common code snippets into their own files, like page headers.

The Jade homepage shows side-by-side Jade and HTML. It's easier to read than HTML for similar levels of familiarity, and it has less junk in the way. Also importantly, it is very fast to convert your current .html files into .jade files - there's an html-to-jade converter.

To set everything up:

You now have the power of jade. You can use it as simply html-with-better-syntax if you like, but you can also refactor commonly-used code into separate jade files and include each file in all the other files that use it. There are quite a few features if you want them, check out the Jade reference. The "includes" and "mixins" sections are the ones I'm most excited for.

[1] If you have any <pre> tags in your code, the html2jade converter seems to handle those imperfectly, so check those manually. Jade handles it correctly though, so you'll only have to fix it when you first convert your existing files into jade.