This is the log of the creation of this website. You may read as a tutorial.
- Before start.
You need to download the following software environment.
- Install the environment
Create a directory that will contain your web file. For example D:\myweb
.
Then open Visual-Studio-Code -> Terminal -> New Terminal and cd
to your directory.
Install the hexo environment.
1 | npm install hexo |
Create a hexo project.
1 | hexo init [your file name] |
cd
to your project file. For example D"\myweb\XXXXX.github.io
to do the following step.
Install the Node.js package manager.
1 | npm install |
After all, your environment is ready. Type the following code to confirm.
1 | hexo g |
ctrl + left click to open the link, you will see the initial page of your website.
- deploy your website to github, publish to the network.
Open a repositories on github and name it as [your-account-name].github.io
.
Generate and/or adding your SSH key to github account.
Open Git Bash, and type the following code with your github email account.
1 | ssh-keygen -t rsa -b 4096 -C "your_email@example.com" |
Then you will get.
1 | > Generating public/private rsa key pair. |
Add you SSH key to your github account as following https://help.github.com/en/articles/adding-a-new-ssh-key-to-your-github-account .
finish the github works, we back to our local project continue the setup.
Install the deployer in your project file.
1 | npm install hexo-deployer-git --save |
Check the _config.yml
under your project file. This file contain all the config of your website including the title, url…etc.
At last of the file, you will see deploy:
, we need to change it as following.
1 | deploy: |
deployer and publish your website.
1 | hexo d |
you will see the website on [githubaccount].github.io
.
Backup your blog to github
still using visual studio code terminal at the project file.
connect your git to github repository.
1 | git init |
add a new branch.
1 | git checkout -b [yourbranch name] |
Then you are Switched to a new branch “hexo”.
Backup 3 step!
1 | git add . |
Basically you are done all the jobs. The next step is to add some content and maintain the themes.