Hexo carries a personal blog on github

original
2016/03/26 17:52
Number of readings 757

get ready

1. Git-2.5.1 Download address: https://git-scm.com/download/
2.node-v4.4.1  Download address: https://nodejs.org/en/

Install hexo

In the specified folder (E:/hexo), right-click ->Git Bash Here to install hexo:

 npm install -g hexo
Since Hexo will be uploaded to github later, you need to install a plug-in, otherwise you will report: ERROR Deployer not found : github, Installing plug-ins
 npm install hexo-deployer-git  --save

initialization

 hexo init
Execute the init command to initialize hexo to the directory you specified, that is, the current E:/hexo directory

The following commands should be used frequently:

 $hexo g # The complete command is hexo generate, which is used to generate static files $hexo s # The complete command is the hexo server, which is used to start the server and is mainly used for local preview $hexo d # The complete command is hexo deploy, which is used to publish local files to github $hexo n # The complete command is hexo new, which is used to create a new article $hex clean # Used to clear the cache
After init, under the E:/hexo folder:

Source: It stores our blog source code
Themes: different themes stored
_Config.yml: main configuration file

Generate static file:

 hexo g

At this time, there is one more folder public Folder, which contains the generated static page file. If you want to regenerate it, you can first execute:

 hexo clean
The public folder will be deleted

Upload github

Now that we have prepared our blog, we can:
1. Local test

 hexo s
Start the server by localhost:4000 Visit, confirm that there is no problem, and upload to github.

2. Upload to github

2.1 Before uploading to github, we need to new respository, There is a fixed writing method for creating a repository:

 your_user_name.github.io

My user name is ksfzhaohui, and all the resolutions I created are: http://ksfzhaohui.github.io/

2.2 After creation, we need to modify Master Profile _Config.yml, open the file and pull it to the end of the file:

 deploy: type:
Here we want to change it to our disposition:
 deploy: type: git repository:  https://github.com/ksfzhaohui/ksfzhaohui.github.io.git branch: master
2.3 Upload hexo

 hexo d

After uploading, there will be one more under our folder .deploy_git Folder. This folder is synchronized with github,

The following can be accessed, such as my blog address: http://ksfzhaohui.github.io/

Blog

 Hexo nBlog name

An md file will be created under the source/_posts folder. You can learn Markdown Syntax Description After writing, you can follow the steps above:

 hexo g   Generate static files hexo d   release

Scalability

Hexo provides good extensibility, including themes and various plug-ins;

Various official themes , can be accessed via _The config.yml file is used for related configuration, which will not be explained here

Expand to read the full text
Loading
Click to lead the topic 📣 Post and join the discussion 🔥
Reward
zero comment
twelve Collection
one fabulous
 Back to top
Top