Requirements

  • PHP 7+ (maybe a MAMP or LAMP stack).
  • Access to a command line via something like Terminal on a macOS system or the command prompt on Windows.

Downloading the Software

The latest version of GreenHat can be found on GitHub at: GordyAnsell/GreenHat. You need to clone or download that software to your local machine.

There should be three root directories:

  • CodeIsGreen: which is my PHP and SCSS framework.
  • example-site: which is an example site running GreenHat.
  • SBS: which is the static blogging software itself.

After you’ve first downloaded the software, duplicate the example-site directory and rename the duplicate to something that represents your own site. I’ll refer to that as your-site from now on.

Testing the Software

  1. Open up a command prompt.
  2. Navigate to the your-site directory as created above.
  3. Type: php ../SBS/run.php dir=. --dev --serve and press enter.
  4. Go to http://0.0.0.0:8081 in a browser and you should see a barebones site.

The software uses PHP’s in-built server to run the site on your local machine. When you want to stop that server, press CTRL+C at the command prompt.

This is a development version of the site, designed for testing things before you go live.

Taking a Site Live

When you’re content with things, you’ll eventually want to make your site live. You do that like this:

  1. Open up a command prompt.
  2. Navigate to the your-site directory as created above.
  3. Type: php ../SBS/run.php dir=. and press enter.
  4. This generates a production version of the site in the _site subdirectory of /your-site/.
  5. Now FTP the site to your server. The contents of your-site/_site need to be copied to the web-root of your server (often the public_html directory).