<commit_before>[![Stories in Ready](https://badge.waffle.io/code-computerlove/node-static-site-generator.png?label=ready&title=Ready)](https://waffle.io/code-computerlove/node-static-site-generator)

# Basic website generator.  

> Get yourself going with a ready made basic static website setup

This repository holds the standard SASS, JavaScript and Testing suit for any website at start level.

The site uses [Gulp](https://www.google.com) as a task runner.

The site is setup to use <NAME> [csswizardry's](https://github.com/csswizardry) ITCSS (inverted triangle) methodology. See [Managing CSS Projects with ITCSS](https://speakerdeck.com/dafed/managing-css-projects-with-itcss) for further details.

This setup will enable you to run a local node server based instance of a website. Through the use of handlebars templating you will be able to publish your website out into pre-compiled static HTML files.
It also gives you the ability to package the site up with all the necessarry files.

## Installation

Do one of the following

* Clone the git repo - `https://github.com/code-computerlove/node-static-site-generator.git`

### Gulp (Client side setup).

* Open a new command prompt (or Terminal on mac).
* Navigate to the folder
* run - `npm install` (sudo may be required for mac)
* run - `gulp`
* run - `node website.js`

### production and release files.

* run - `gulp build --prod`
* run - `gulp release --prod`

adding `--prod` after any command will compress and minify the relevant files.

### viewing your site
An index has page has puprposely been ommited from this setup to encourage you to build from a styleguide.

navigate to `http://localhost:3001`

or

if you have run build you can navigate to the build folder and open the static HTML files

### 3rd party plugin notes.

#### [gulp-sass-generate-contents](https://github.com/andrewbrandwood/gulp-sass-generate-contents)
To enable the compiling of a list of contents in the main scss file and to import all the correct files.  It is required to have a comment at the top of each sass file. 

anything on the first line other than a double slash // will result in the file being ignored from the contents and the imports. (see options to change this)<commit_msg>docs(README): Update readme with template data information. Small amendments<commit_after>[![Stories in Ready](https://badge.waffle.io/code-computerlove/node-static-site-generator.png?label=ready&title=Ready)](https://waffle.io/code-computerlove/node-static-site-generator)

# Basic static website generator

> Get yourself going with a ready made basic static website setup

This repository holds the standard Sass, JavaScript and Testing suit for any website at start level.

The site uses [Gulp](https://www.google.com) as a task runner.

The site is setup to use Harry Roberts [csswizardry's](https://github.com/csswizardry) ITCSS (inverted triangle) methodology. See [Managing CSS Projects with ITCSS](https://speakerdeck.com/dafed/managing-css-projects-with-itcss) for further details.

This setup will enable you to run a local node server instance of a website. Through the use of handlebars templating you will be able to compile your website into pre-compiled static HTML files.
It also gives you the ability to package the site up with all the necessarry files.

## Installation

* Clone the git repo - `https://github.com/code-computerlove/node-static-site-generator.git`

Once you have the source code, you will need to do one of the following: 

#### Gulp (Client side setup).

* Open a new command prompt (or Terminal on mac).
* Navigate to the folder
* Run the following commands
    * `npm install` (sudo may be required for mac)
    * `gulp`
    * `node website.js`

#### Production and release files.

If you need to compile your templates

* `gulp build --prod`. This will do a full build (HTML compile, style compilation, minification) and output in the `build` folder.
* `gulp release --prod`. This will do the same as the above build task but also package all assets into a zip file in the `release` folder.

adding `--prod` after any command will compress and minify the relevant files.

### Viewing your site

An index has page has puprposely been ommited from this setup to encourage you to build from a styleguide.

Ensure you have a local server instance running using `node website.js` and then navigate to `http://localhost:3001`. 

If you have run the `build` task you can navigate to the build folder and open the static HTML files.

## HTML Template Data

Template data is stored in the `templateData.json` file located in `_config` folder. Anything stored in this file is piped to the handlebars templates under the `data` namespace. If you want to output the value of the key `pageHeading` this would be done via `{{ data.pageHeading }}` (The double brackets tell handlebars to output a dynamic value). As this file is standard json - arrays and objects can be added and used for template loops, passed to partials etc without issue.

### 3rd party plugin notes.

#### [gulp-sass-generate-contents](https://github.com/andrewbrandwood/gulp-sass-generate-contents)
To enable the compiling of a list of contents in the main scss file and to import all the correct files.  It is required to have a comment at the top of each sass file. 

anything on the first line other than a double slash // will result in the file being ignored from the contents and the imports. (see options to change this)
{'fraction_non_alphanumeric': 0.07868252516010979, 'fraction_numerical': 0.0018298261665141812, 'mean_word_length': 4.2206303724928365, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 6, 'https://': 14, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '552930', 'n_tokens_mistral': 1511, 'n_tokens_neox': 1468, 'n_words': 741}