Not the suspense

I use Github to build my blog. Github provides 300M domain name space, which eliminates the trouble of buying a server and building it. I have to say that it is very considerate (PS: sometimes slow and weak to ridicule). If you don’t have an account, you can’t wait to apply for an account. Don’t worry. Set up a blog.

To prepare

Node.js, Hexo, NexT, git, Github account, file storage server.

If you know these keywords, you can skip them.

Node provides environmental support for Hexo. Hexo is a simple, fast and powerful blog publishing tool based on Github Pages. NexT Hexo theme, you can choose something else, I prefer something simple. Github is the world’s largest code hosting platform. Git is a tool for pushing Hexo compiled files to Github. The file service is used to store pictures, audio and video files for blogs.

Here’s what you need

The installation of the Node

Rare more human environment installation program, has been the next step to complete! Download address (usually LTS version).

Git Tool Installation

The tool for managing Github code, which you can think of as another SVN, is currently working in a completely different way. Download address

One Github account

As the world’s largest gay social network, you shouldn’t be unaware. Click on the register

Hexo

Hexo is a simple, fast and powerful Github Pages based blog publishing tool that supports the Markdown format and has many excellent plug-ins and themes. The website links

Hexo

Set up

In the same way as Easy, perform the following instructions to complete the Hexo installation.

NPM install hexo-cli -g // Install hexo’s scaffolding hexo init blog // create a blog project CD blog // enter the blog project NPM install // install the project required to rely on hexo server // Project running

instruction
The main interface

Next

Hexo’s theme is popular for its minimalist interface. Official website address support: [set RSS] [add “tag” page] [add “classification” page]

The topic configuration

Github.com/iissnan/hex…

Personality configuration

All configurations are in the _config.yml file. Careful students may notice that both the root directory and the theme file have the _config.yml file. The _config.yml in the root directory is used to configure the basic information of the site, as well as the topic configuration and Github project address mentioned above. The _config.yml theme is used to control some themes and styles in the blog. When modifying the configuration, add a space after the colon; otherwise, problems may occur.

Making use of

How to create

Create an account if you don’t have one, and then create the repository, as shown

Create a warehouse
Create a warehouse

Setting Upload Permission

The so-called permission is to generate a key locally through Git bash. This key is saved in the Github account. Any code upload and modification must be submitted through the computer with this key.

To generate the key

Execute the following commands respectively

Git config –global user.email git config –global user.email

All Git uploads carry user information. This is how the information is generated. Generate the SSH key

Ssh-keygen -t rsa -c “Your email”

You will wait three times for input, just press enter, and then you will see the path of the key file, usually C:\Users\ administrator. SSH find id_rsa.pub.

Adding an Authorization Key

Copy in the key obtained in the previous step, as shown in the figure.

newrepository
newrepository

Blog post

Follow this installation instruction (a prerequisite for deployment to Git).

npm install hexo-deployer-git –save

Execute the following command and you are ready to publish

hexo clean hexo generate hexo deploy

Although the official advice is to simply execute deploy, it is recommended to execute the above three commands separately for safety reasons.

Hexo common directives

Hexo new “postName” # new article hexo new page “pageName” # new page hexo generate # static page to public directory hexo server # enable preview access port (default port 4000) ‘CTRL + C’ to close the server) hexo deploy # Deploy to GitHub hexo help # View the version of hexo

abbreviations

hexo n = hexo new hexo g = hexo generate hexo s = hexo server hexo d = hexo deploy

Recommended authoring tools

After looking for Markdown to write tools for a long time, I found a free software called Haroopad to be easier to use, so I recommend you to use it. Download address