What is a static website generator you ask? And why the hell would I want one?
The advantage of this first and foremost is speed, compare the speed of a simple static site to that of a full blown node application and the difference is night and day, no matter how leet your optimisation skills are.
This is the main reason that I chose GatsbyJS as the basis for Devstache, speed and the convenience of being able to just pick the site up and move it from server to server, being able to deliver the content via CDN, therefore serving it closer to the end user.
So....how do I get started with this Gatsby greatness?
Install your development environment.
Install the GatsbyJS command line interface.
Open the terminal and type:
npm install --global gatsby-cli.
Lets create our first project!
Inside the terminal, type the following, where project-name, is the name that you want to call your project.
gatsby new project-name
This will kick-off the installation process, where gatsby cli will create all of the template files and install all of the dependencies.
Navigate to your project directory within the terminal
This will do a few things, firstly it will run eslint, to ensure there are no errors in your code, and secondly is will start local development server, available at localhost:8000 by default.
That's it!! Open your browser and navigate to localhost:8000 to see your shiney new website in full glory!
Now we have this site, how on earth do we delpoy it? what are our options? I will cover this part next.