Book Image

Grunt Cookbook

By : Jurie-Jan Botha
Book Image

Grunt Cookbook

By: Jurie-Jan Botha

Overview of this book

<p>A web application can quickly turn into a complex orchestration of many smaller components, each one requiring its own bit of maintenance. Grunt allows you to automate all the repetitive tasks required to get everything working together by using JavaScript, the most popular programming language.</p> <p>Grunt Cookbook offers a host of easy-to-follow recipes for automating repetitive tasks in your web application's development, management, and deployment processes. This book will introduce you to methods that can be used to automate basic processes and your favorite tools. By following the recipes, you will soon be comfortable using Grunt to perform a wide array of advanced tasks in a range of different scenarios.</p>
Table of Contents (17 chapters)
Grunt Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Adding data to the site


Quite often we'll find that the majority of the content on a site repeats a pattern, and that only certain parts of the content differ from page to page. A site that displays articles for instance, will display each article using the same layout, and also have them listed in a repetitive manner. As developers, we'd probably like to avoid having to create each of these similar structured pages or items by hand.

For this purpose it's usually recommended to store the content we like to display in this fashion as data, which we can then render using a template or layout that will present each of them with the same template.

Getting started

In this recipe we'll continue working with the project from the Adding content to the site recipe found earlier in this chapter. Be sure to refer to it if you are not yet familiar with its contents. Before we start we should also make sure that the site builder and server are running. If they aren't yet running they can be started using...