1. Install node. js
: Portal
Go to the node. JS official website to download the appropriate version and install it.
The NODE-V command can be used to test whether the Nodejs is successfully installed
2. Install git
: Portal
Go to the Git website to download the appropriate version and install it.
Select cmd in the second system can also be used
You can test git for successful installation with git–version commands
3. Register your GitHub account
Go to the Github website to register.
Remember to add SSH Key when you're done registering.
This SSH key is an authentication that allows GitHub to recognize the binding of this machine, allowing this machine to be submitted. Execute the following command:
CD ~/. Ssh
~ This symbol, indicated in the user directory
Execute code if prompted: No such file or directory indicates that you are using Git for the first time.
Here's how to configure SSH Key.
4. Production of new SSH key configuration
Executing code in GIT bash:
"85268837 @qq. com "
Remember to change to your own email address.
After success, two files Id_rsa and id_rsa.pub are generated. ,
5. Add SSH key to GitHub
These two files are in the. SSH directory of the user just now.
After adding SSH key on GitHub, in the upper right corner of any interface, click on your avatar and select settings-> ssh keys->new ssh key
Add success!
6. Build a Blog
Installing Hexo
Create a new Blog folder locally, right-click on the file and choose Git Bash.
Enter the command to install Hexo:
When installation is complete, test the Hexo for successful installation by entering the Hexo command, as shown:
Then initialize the Hexo:
Hexo Init Hexo
Initialization success will show start blogging with hexo!
At this time in the blog you just created will be more than a Hexo file
Enter the Hexo directory, enter the instruction NPM install, install dependent files, and deploy to form files
Open the Hexo directory
CD Hexo
Installing dependent files
NPM Install
Deploy to form Files
Hexo Generate
Last left running server
Run up Hexo Service
Hexo Server
This prompt Hexo is running at http://loalhost:4000/.
Then we open the browser and enter Http://localhost:4000/to see the default blog.
Here, Hexo has been installed.
7. Configure Githubpage
Login to GitHub and click "New Repository" to create a new repository
Enter the warehouse name: your github name. Github.io. Then click Create Repository.
Note: This side of the creation of the name, be sure to use the GitHub user name, otherwise not show, because Githubpage can only your user name.
Enable GitHub Page
Click on the "Setting" menu on the right to enter settings, click "Launch automatic page Generator"
Click "Continue to Layouts" at the bottom after entering
Then select a random template and click on "Publish page" to publish a static site generated by GitHub by default
Try opening your own static web site on GitHub, and you'll find that opening is the static site template you just chose.
8. Host the local Hexo project to GitHub
Open the Modify Hexo directory under configuration file _CONFIG.YML.
Edit the last Deploy property and add the code:
type:gitrepository: [email protected]:c237878/c237878.github.io.gitbranch:master
Type use is git.
Change the Repository property to your repository git address you just created.
Branch Branch fill in master.
This way. Local Web site configuration file _config.yml
Web site configuration file, you can configure some of the basic information here, here are some key configuration:
# Hexo configuration## Docs:https://hexo.io/docs/configuration.html# # Source:https://github.com/hexojs/hexo/# Sitetitle:dududzai ' s Blog #网站的标题subtitle: Life isstruggle #副标题description: life isstruggle #描述author: examble #作者信息avatar:/images/avatar.png #头像, picture location in the corresponding topic directory of Imageslanguage:zh-Hans #中文简体email:85268837@qq. comtimezone:# extensions## Plugins:https://hexo.io/plugins/# # Themes:https://hexo.io/themes/Theme:next #配置主题, use the next theme stylus:compress here:true#自适应布局 # deployment## Docs:https://hexo.io/docs/deployment.htmlDeploy:type:git #部署环境, based on Hexo+githubpage, so use git here. Note: Different versions of Hexo,type may be different,3. x should use git later, see Official document repository: [Email protected]:username/username.github.io.git #git仓库地址, replace it with your username, the rest remains the same, and later it mentions how to create a git repository branch:master
Modify it according to your needs!
Installing the Hexo-deployer-git Plugin
NPM Install Hexo-deployer-git--save
deploy your local theme to GitHub
Code below, each time you modify a local theme, you need to execute the following code
Hexo Cleanhexo Generator #简写 hexo ghexo deploy #简写 hexo D
Finally look at the effect of deploying to GitHub!
Well, above install Windows using Hexo+githubpage Build blog.
Reference article:
http://duduzai.github.io/2016/03/22/first-hexo/
http://www.v2ex.com/t/175940
The process of using hexo+githubpage to build a blog under Windows