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 a page to the site


As its core, a static website is just a collection of pages. With our basic setup in place we can look at adding a page that contains some biographical information about us.

Getting started

In this recipe we'll work with the basic project structure that we created in the Setting up a basic site project recipe earlier in this chapter. Be sure to refer to it if you are not yet familiar with it's content. 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 the grunt server command.

How to do it...

The following steps take us through adding a page to our static site that will contain our simple biography:

  1. First we'll create a file called bio.hbs in the src/templates/pages directory and fill it with some information about our new page:

    ---
    title: Bio
    heading: 'Biography'
    ---

    Tip

    The initial part of the file is called the YAML front matter section which can be used to provide metadata about...