Now that you got everything up and running, don’t forget to set up a repository and version control your new website. The Hexo generator already provides a .gitignore file for the basic assets and logs.
Set up initial git repo
git add .
git commit -m 'initial commit'
File and folders
Let’s take a look at Hexo’s file structure:
Hexo file structure
drwxr-xr-x 7 root root 4096 Jun 22 14:17 .
drwxr-xr-x 3 root root 4096 Jun 22 14:12 ..
drwxr-xr-x 8 root root 4096 Jun 22 14:18 .git
-rw-r--r-- 1 root root 65 Jun 22 14:12 .gitignore
-rw-r--r-- 1 root root 1477 Jun 22 14:12 _config.yml
-rw-r--r-- 1 root root 14536 Jun 22 14:13 db.json
drwxr-xr-x 12 root root 4096 Jun 22 14:12 node_modules
-rw-r--r-- 1 root root 447 Jun 22 14:13 package.json
drwxr-xr-x 2 root root 4096 Jun 22 14:12 scaffolds
drwxr-xr-x 3 root root 4096 Jun 22 14:12 source
drwxr-xr-x 3 root root 4096 Jun 22 14:12 themes
The settings for your website. Take a look at the docs for some basics.
Stores your data when using hexo server to preview your website
Templates for page layouts like page, post and draft
Pages and posts. Your static content that will be rendered.
Well, the installed themes, obviously.
Pretty simple. Right?
Due to Hexo’s modularity, it’s pretty simple to install new plugins and themes. All you need is just a single npm install or git submodule add away.
After the installation, change the theme variable inside _config.yml to your themes (folder) name
Note: When making changes to the _config.yml file, you need to cancel at start the hexo server over, since those changes are not detected on run time.
For further configuration and customization, take a look at Hexo’s _config.yml as well as the one the theme of your choice provides.
As you can see, setting up and running Hexo is done within minutes - and it attempts to stay as simple and minimalistic as possible. This is where Hexo - in my opinion - succeeded other static site generators I tried (like Jekyll, Metalsmith and Harp).
In the next part of this series we’re going to set up an Amazon S3 bucket to deploy our previously created Hexo website into, and make it available to the world using the AWS stack.