Hexo blog configuration
This is my first official post. As a start, I will introduce how to configure a personal blog using Hexo framework. Just like the website you’re browsing now.
Please note that the operating system I use is Windows10(64-bit) and most of the processes was done in PowerShell(“Win+R”→enter “poweshell”→”Enter”). If you are using other operating system, please refer to the Hexo Documentation.
Install Hexo environment locally
You have to install Node.js, Git first, which is the base of hexo installation. And their websites may offer more canonical guidance.
Install Node.js
Go to Node.js website and download Windows(x64) Long Term Support(LTS) schedule. Just open the node-v18.16.0-x64.msi(the version I downloaded) and install it like other softwares following the guide. You can open the PowerShell and check the version to make sure the successful installation.
1 | |
Install Git
Go to Git website and download the latest 64-bit version of Git for Windows. Open the Git-2.40.1-64-bit.exe and install it. You may also check the version to make sure the successful installation.
1 | |
Install Hexo
Create a new folder Blog in D: disk(or any other disk if you want, but C: is not recommended).
1 | |
Enter the directory and install Hexo using npm.
1 | |
Again, check the version to ensure the installation.
1 | |
Write your very first blog
After the installation, initiate hexo.
1 | |
A bunch of project files are created in Blog folder you created. Like this:
Create a new blog named “get-started” in Blog folder.
1 | |
Note that the original file stored in /source/_posts(D:/Blog/source/_posts in my case ). And the file is in markdown(.md) format. You can edit it in text editing softwares, like vscode I am using now. And there are a lot of guidance about markdown format online, it’s really easy to learn. I will deposit one here in case you need.
Generate the blog:
1 | |
Launch the hexo server in Blog folder:
1 | |
Now you can preview your Hexo blog in browser by entering http://localhost:4000/:
A big success!
Deposit your Hexo to the remote end
Now you can create new blogs and browse them locally! But that’s not enough, you have to share the blog with other people. So it’s necessary to deposit it to remote end.
The domain name I use is from github, which is free. There are a few steps you have to carry out(I assume that you already have a github account):
- Log in the github and create a “new” repository.
- Use your nickname as new repository’s name and “create repository”.
- Return to PowerShell and enter:
1
npm install hexo-deployer-git --save - Open the _config.yml file in Blog, and enter the following contents to configure:

The content after “repo” is the address of new repository, which you can find in your github page.
Save the file. - Return to PowerShell and enter:Please note that the connection to github is not stable sometimes, you can try a few more times until there is no errors.
1
hexo d # The same as "hexo deploy" - Open the browser and enter https://github.com/example/example.github.io.git(substitute with your own repository’s address). If you can see exactly the same content as the local one, congratulations!
After this configuration, you can use the following commands to create a new blog:
1 | |
Change the theme and make your blog searchable
Now, you can write new blogs and share them with your friends. But if you want to beautify the interface, changing the theme may be a good choice. The theme I am using now is called Fluid, which is found in Hexo themes. I just configure the theme as the Fluid website told me, which is relatively easy to follow. Further information about the theme is in its guide page.
You can still do something further. As your website is not included in Google, other users may not search it directly by Google. Refer to Google search center for more information. As my website has not been included by Google either, you can explore it by your self.
That’s all about my first post about create a personal hexo blog, many thanks for your reading. But also note that all guides of this sort may be out of time or not work due to different versions, different systems or other unknown factors… If this protocol doesn’t work for you, you can:
- Search the newest guide in software’s website.(In most cases, this is the most helpful way).
- Search other users’ up-to-date guides or suggestions.
- Contact me by e-mail and discuss together.
Reference
[1] My desk mate’s blog
[2] Hexo
[3] Hexo Documentation
[4] Markdown guide
[5] Hexo themes
[6] Fluid website
[7] Fluid guide page
[8] Google search center
[9] Bilibili video about configuring Hexo
[10] Lizhe’s Blog about submitting website to Google