Category: Templating

AngularJS and Angular 2+: a Detailed Comparison

This article compares the major differences between the the original AngularJS and Angular 2+. If you’re currently stuck with an AngularJS project and not sure whether you should make the jump, this article should help you get started. In recent years, we’ve seen Angular grow tremendously as a framework and as a pl...

HTML Templates via JavaScript Template Literals

You know those super cool backticks-for-strings in new JavaScript? let emotion = `happy`; let sentence = `Chris is feeling ${emotion}`; Besides the variable interpolation in there being mighty handy, the do multi-line strings wonderfully, making them great for chunks of HTML: const some_html = ` <div class="modul...

Four Killer Features of Nunjucks

Nunjucks calls itself “A rich and powerful templating language for JavaScript”, which sounds about right. It’s not intentionally super lightweight like Mustache or the slightly more robust (but still pretty light) Handlebars. It’s a full-on language, packed with all kinds of stuff you might want...

Getting Started with CSS Modules

There isn’t one single approach with CSS Modules to making the JavaScript templates, the CSS files, or the build steps to make them work. In this post, which is part of a series on CSS Modules, we’ll look at one approach. The goal of this post is to get a CSS Modules project up and running. Article Series Part...

Using Inline Partials and Decorators with Handlebars 4.0

Handlebars is one of the most widely used JavaScript templating libraries for both client-side and server-side rendering. It implements the mustache specification but adds some extra sauce to make working with templates easier. If you’re new to Handlebars and want to know more, I suggest you to check out my Plura...

Getting Started with Underscore.js

This article was peer reviewed by Agbonghama Collins and Ryan Chenkie. Thanks to all of SitePoint’s peer reviewers for making SitePoint content the best it can be! Underscore.js is a JavaScript library, written by Jeremy Ashkenas, that provides functional utilities for a variety of use cases that we, as developers, m...

Transphporm – a Different Kind of Template Engine

If there is one thing the world needs, it’s definitely another PHP template engine! But wait, this one is different! Many PHP template engines (Smarty, Blade, Twig…) are little more than abstracted PHP code, making it easier to write loops, if/then/else blocks, and display variables with less verbosity than vanilla...