0x02 - Blogging using Hexo & Fluid
This guide picks up where the Hexo Fluid setup guide left off.
Here, I provide a comprehensive guide on using Hexo blogs with the Fluid theme. We’ll start with basic Hexo configurations and then move on to Fluid theme configurations.
To better understand how everything works in Hexo, let’s delve into the directory structure:
1 |
|
Among these files, the most crucial one is _config.yml
because it contains the Hexo configuration. Here’s a recommended config (customize details like name as necessary):
1 |
|
Note: Changes were made, such as
new_post_name: :title.md
, to improve SEO and manageability.
Moving on, let’s explore other directories:
1 |
|
The
.github
directory is for the workflow that runs our website while hosted on GitHub.
scaffolds
includes files that can be used with the Hexo theme to create pages, posts, or drafts.
source
includes the actual contents of the posts, drafts, and pages.
themes
includes all the themes that can be added and everything related to those themes.
Creating a new post:
As we learned, the source directory contains all the posts, pages, and drafts files. To create a new post, create a new file in the source/_posts
directory, e.g., “blogging_101.md”. Ensure to add .md
as we’ll be using Markdown.
Now, edit the file and add the metadata and contents. For example:
1 |
|
This is how posts can be created using Hexo.
For the about page:
Create a directory in source
named about
. Inside the about
directory, create an index.md
file for the about page content.
To add extra information, modify the Fluid theme config. For example:
1 |
|
For the body of the page, edit source/about/index.md
:
1 |
|
That should cover the basic changes and setup. Feel free to modify other configurations in the Fluid theme _config.yml
file for additional customization like changing the default banner images for the different pages, enabling comments etc.
For my blog take a look here: Github hosting