nationalarchives / tna-base

The National Archives WordPress Parent Theme
3 stars 4 forks source link

tna-base

The National Archives WordPress Parent Theme

1.0 Theme features

1.1 Bootstrap 3.3.6

Mobile first front-end framework http://getbootstrap.com/

1.2 Sass

Using Bootstrap Sass https://github.com/twbs/bootstrap-sass

1.3 Grunt

Grunt as a task manager to aid development http://gruntjs.com/

1.4 Dimox breadcrumbs

WordPress breadcrumbs without a plugin https://gist.github.com/Dimox/5654092

2.0 Development setup

2.1 Create host for WordPress in MAMP Pro

Under the 'Hosts' tab create a new server with Server Name 'tna-base-dev' within the MAMP/htdocs/sites/tna-base-dev/ directory. Having done this click 'Save'.

2.2 1-click WordPress install in MAMP Pro

Under the 'Hosts' tab, with 'tna-base-dev' selected, click Extras and install WordPress, providing:

2.3 Clone Github repository 'tna-base' using SourceTree

Click 'Remote' in SourceTree and you will be shown a full list of repositories you have access to. Then:

2.4 Create a new project for the WordPress installation in PhpStorm

2.5 Enable WordPress integration in PhpStorm

2.6 Running Grunt

Assuming that the Grunt CLI has been installed follow the instructions on the Grunt website.

2.6.1 Available Grunt Tasks

There are several Grunt tasks available to developers. View the Gruntfile.js for a listing of included tasks

Note: it is important to run Grunt before checking in code to ensure all JavaScript tests are passing.

2.7 Composer dependency management

Composer is used for dependency management, initially for PHPUnit but extending to other dependencies as needed.

2.7.1 Installing Composer

To install Composer, from within the tna-base directory open the Terminal and execute this command:

curl -sS https://getcomposer.org/installer | php

This downloads the Composer installer script with curl and executes it with PHP, resulting in a composer.phar file (the Composer binary) being placed in the current working directory.

Having done this follow these steps:

At this stage you should be able to execute the composer command in the Terminal to see all the available options.

2.7.2 Obtaining dependencies via Composer

Having followed the steps above you will be able to install dependencies by typing composer install at the Terminal.

2.8 PHPUnit

Having followed the steps under 'Installing Composer' type vendor/bin/phpunit -c phpunit.xml from within the tna-base directory to run Unit Tests for the project.

Note: PhpStorm allows for PHPUnit integration - allowing your tests to be run automatically. Search the JetBrains website to find out how to configure this.

2.9 QUnit

Any JavaScript written for this theme should be unit tested with QUnit. See the js/tests/example directory for an example QUnit test and fixture.

3.0 Credits