New project

Introduction

Let's assume you just sat through the installation process, and now you want to initialise a new project for you to work on. Use the command line again to change the directory to your project folder.

cd some/where/on/you/computer/my-project

If you don't feel comfortable traversing your filesystem like this, you can achieve the same result by (on a Mac) dragging any folder onto the Command Line icon, or (on a Windows machine) right clicking any folder while holding the Shift key and choosing "Open command window from here".


Initialising a project

To start a new project in the folder that you just created, you have to instruct Headstart to populate it with the default boilerplate files.

headstart init

This will fetch the files directly from Github into a .tmp folder, extract them, and clean up afterwards. If your command line isn't pointing at an empty folder, it will ask you what to do—twice!—to prevent you from deleting any files by accident.

When the downloading and extraction have completed, you will be asked a few yes-or-no questions to help you get started. If you don't want to do this just yet, just type n, hit enter, and you'll be left alone.


Customising the boilerplate files

If you want to make changes to the default boilerplate, you can fork the Github repo and use your own repository to initialise your projects:

headstart init --base gituser/repo

Make sure to replace "gituser/repo" with your username and repo.

Headstart enforces a few naming and folder conventions to work properly, but (almost) every file is delete key friendly content-wise. Here's what you should keep in mind before you start trashing about:

  • Folder structures and names are needed to do the grunt work for you. Renaming or removing folders will likely break some things / everything.
  • Don't remove config.json or .jshintrc.
  • All Sass files and subfolders can be removed, except for main.scss and any view-*.scss file.
  • All JS files can be removed, except for main.js and any view-*.js file. Folder structure is important, so keep things like libs or ie/head in place.
  • Only templates/layout and templates/partials can be used for templating. You don't have to use them, but using other folders won't yield any result (unless you are using some kind of back-end integration).

Next step: Building your project