My server was about to expire recently, so I decided to migrate VRC Blog to GitHub. I started looking for a good theme. I originally wanted to use the Typecho theme I’m currently using (which was ported from Jekyll), but I couldn’t find it when I searched for it half a year ago. Lately, I’ve been wanting to check out Hexo. After searching for themes, I remembered that Argon, which I really like, has a Hexo version. Hence, this article.
Environment
Requires Node.js 10.13 or higher (12.0+ recommended).
Requires Git.
Installation
Run the command:
| |
Check if the installation was successful:
| |
Create a New Blog
Navigate to the folder where you want to install:
| |
Enter the folder:
| |
Install dependencies:
| |
After creation, you can modify ./_config.yml for configuration.
Install a Theme
Pick a theme from the Theme Store . Installation methods may vary by theme, so refer to the specific theme documentation.
The following steps are for the Argon theme:
Clone the Theme
First, clone the theme repository into the ./themes folder:
| |
Rename the cloned folder to argon.
Install the ejs renderer:
| |
In the ./_config.yml file, set the theme to argon.
Configuration File
Modify ./themes/argon/_config.yml to change settings.
Configure Search
Run this in the root directory:
| |
Then add the following options to ./_config.yml:
| |
Writing
Create a new post:
| |
[layout] is an optional attribute:
| Layout | Description | Path |
|---|---|---|
| post | Post (default) | source/_posts |
| page | Page | source |
| draft | Draft | source/_drafts |
Once created, you can start writing your article.
Preview:
| |
Visit localhost:4000 to view.
Generating Static Files
Run the command:
| |
Running this command only generates files that don’t exist yet. It’s usually better to clean the previous build before generating.