Skip to content
Ollie edited this page Apr 27, 2016 · 9 revisions

Requirements

Dependencies

  • nodejs & npm (sudo apt-get install nodejs npm)
  • bower (sudo npm install -g bower)

Installation

Bower Packages

Ensure that bootstrap, font-awesome and other project-specific front-end dependencies are installed:

bower install

Gulp tasks

Install the recommended gulp tasks:

npm install

Note: If you are in a virtualised environment that doesn't support symlinks add:

--no-bin-link

To the end of the above command.

Available Gulp Tasks

  • gulp watch - Bootlint files, Compiles LESS or JS lint (And minify!) on file changes
  • gulp less - Compiles LESS files
  • gulp bootlint - Run Bootlint on HTML/PHP files
  • gulp jshint - Run jshint on JS files
  • gulp js-build - Build JavaScript
  • gulp images - Optimise images
  • gulp js-build-dev - Build JavaScript but keep the code minified (For debugging purposes during development)

File Structure

Setup default file structure:

layout/
layout_inc/head-script.php
layout_inc/header.php
layout_inc/nav.php
layout_inc/footer.php
layout_inc/footer-script.php
less/
public/css/
public/js/
js/
blank.php
index.php
README.md
styletile.php
styleguide.php

Blank template

Setup blank.php page template:

<!DOCTYPE html>
<html lang="en">
	<head>
		<?php require($_SERVER['DOCUMENT_ROOT'].'/layout_inc/head-script.php'); ?>
		<title></title>
	</head>
	<body>
		<?php require($_SERVER['DOCUMENT_ROOT'].'/layout_inc/header.php'); ?>


		<?php require($_SERVER['DOCUMENT_ROOT'].'/layout_inc/footer.php'); ?>		
	</body>
</html>

Git Branches

Ensure there is a master, testing & dev branch setup in the repository.

git checkout -b <BRANCH NAME>

Path corrections

For Font Awesome integration ensure the following line is added to /less/variables.less for font dependency. Path needs to be relative to compiled stylesheet.

//** fonts path for font awesome
@fa-font-path:  "../../bower_components/font-awesome/fonts";

Readme template

Once initial project work as been setup then ensure the README.md is setup with the following code blocks filled out:

# <Project Name>

# Installation
## Gulp Tasks
`npm install `

## Bower Packages
`bower install`