Why do I restart a new one?
It’s more than a year that I didn’t update the blog and lolts of the info are hard to remember if you didn’t do it frequenlty and routinely. It’s really important to write something down that really important for you. In the past, I also write down some unrelated articles. But the time is limited, it’s hard to find the right Therefore, I restart a new blog style trying to record and share what I learn as a reference.
I know there are plenty of note software or services that publish articles conveniently, and some of the blog frames, like WordPress, are also easy to build up. However, it’s also enjoyable to make some handmade progress and make progress quickly.
Install Hexo
- Install Git
- Install Node.js through nvs from the Github releasing page. (Hexo service is based on GitHub; nvs is the node.js version management tool for Windows OS recommend by Hexo officially.)
- Open PowerShell and type
nvs
, select the LTS version (e.g. the version with the name like Gallium) and install it. Note: need to start the - Install Hexo with the command
npm install -g hexo-cli
- Check the version through
hexo -v
Generate a new blog & upload to the GitHub
- Create a new local file location
1 | $ hexo init <folder> |
-
Create a testing Hexo frame through
hexo g
and thenhexo s.
”g” means generate, s means server. Now, you create the first Hexo blog page! -
Open the file
_config.yml
in your blog folder to set the info link to GitHub (Note: recommend installing an editor software like VS code or Notepad++ for the enhanced function). The configuration should be like the following:1
2
3
4
5
6deploy:
type: git
repo: <https://github.com/><username>/<project>
# example, <https://github.com/hexojs/hexojs.github.io>
branch: gh-pages
# change the branch name to master if you are lazy. -
Setup the SSH keys
-
Upload the blog with
hexo d
-
The blog name should be like https://[username].github.io/[branch name]/
Install useful packages
-
npm install hexo-deployer-git --save
Deploy the blog to GitHub
Using Hexo in Windows
This section is to record how to start the hexo environment in Windows. we need to start the node.js first under nvs commend.
-
Open the Windows Powershell (Or just right click the “open Terminal” from the options in the folder in explorer) in the blog folder where you generate the Hexo blog.
-
Launch nvs and select the proper node.js version (The version that I install the node.js)
-
Can start to commend Hexo like hexo s; hexo g; hexo d…etc.
-
S for server (run the blog in the local machine)
-
g for generate (generate the static blog website for uploading)
-
d for deploy (deploying the context to the internet)
-
Reference
Note
- python3 -m http.server