GreenHat SBS installation

Installing Node and NPM

GreenHat SBS is a Node.js project, installed via NPM (Node Package Manager), so those need to be installed first.

You can download an installer for your platform here: https://nodejs.org/en/download/

Run the installer and follow the instructions. This will install both node and NPM.

Installing GreenHat SBS

The best way to go about this is to add a package.json file to the root of your website.

Create a new local directory for the site and add the package.json to that.

The package.ison file should be as follows:

{
    "name": "a-name-for-your-site-no-spaces",
    "version": "0.1.0",
    "description": "Your site description.",
    "homepage": "https://your-site-url.com",
    "license": "MIT",
    "minimum-stability": "dev",
    "authors": [
        {
            "name": "Your Name",
            "email": "contact@your-site-email.com"
        }
    ],
    "dependencies": {
        "greenhat-sbs": "*"
    }
}

Replace the ‘your-site’ fields with things appropriate to your own site. The important bit (that should remain as specified above) is the dependencies section.

How open a Terminal/Console window and navigate to your site directory in that and then type:

npm update

You should have SBS installed following that.

Generate a new site

Now that SBS is there, it can generate a new site for you.

Make sure you’re still in the directory where you want the site generated and type the following into the Terminal/Console:

node node_modules/greenhat-sbs/app.js --sitegen

You can then test your site by running:

./run-dev.sh

The last console message will give you the address of the locally running site. If you copy that address and paste it into your browser you should see your site.