Process#
Documenting the process of building a blog
- The framework used is Hexo, and the theme used is Fluid. The local deployment went smoothly by following the tutorial.
- When adjusting the configuration, I encountered some issues. Initially, I used
npm install --save hexo-theme-fluid
, but when modifying the configuration, although there was documentation, I didn't know how the configuration items were nested, so I chose option two. - After configuring locally, I needed to deploy it to Github Pages. In the tutorial provided by Hexo, they used the
GITHUB_TOKEN
variable provided by the built-inGithub Action
. According to the official documentation, to prevent recursive builds, the code pushed usingGITHUB_TOKEN
won't trigger any actions again. However, considering that I want to further trigger and understandGithub Action
in the future, I chose to set my own key. - This step took the most time. I took many detours and finally referred to Automatically Deploying a Blog Using GitHub Actions.
- The action ran successfully, but when accessing the blog, I found that it still showed a 404 error. After checking, I realized that I hadn't configured a publishing source for my GitHub Pages site.
- Adding Google verification:
I referred to Making a Blog Hosted on Github Pages Searchable by Google- (Omitted) When verifying website ownership, I chose to use the HTML tag method. The path to the head file in the fluid theme is
\themes\fluid\layout\_partials\head.ejs
.
- (Omitted) When verifying website ownership, I chose to use the HTML tag method. The path to the head file in the fluid theme is
- Reducing loading time, not yet implemented, but here are a few good articles I found:
- Inserting images, this article explains it well:
Various Ways to Insert Images in a Hexo Blog - Adding last modified time:
Setpost:copyright:update_date:enable:
toenable
in the theme configuration file_config.yml
.
Quick Start#
Create a new post#
$ hexo new "My New Post"
More info: Writing
Run server#
$ hexo server
More info: Server
Generate static files#
$ hexo generate
More info: Generating
Deploy to remote sites#
$ hexo deploy
More info: Deployment