First, install Node.js

Website:nodejs.org/en/, direct installation can!



Check the version after installation:



NPM, the package manager on Node.js, is used to download Hexo, but it’s too slow.

First use NPM to install the domestic Taobao image source CNPM. The steps are as follows

npm install -g cnpm --registry="https://registry.npm.taobao.org"
Copy the code

After downloading, check out:

CNPM installation hexo

cnpm install -g hexo-cli
Copy the code

For NPM installation:

npm install -g hexo-cli
Copy the code

Check whether the installation is successful:

Start blogging

  • Create a new folder for blogs, go to the folder, and start initialization
hexo init
Copy the code

Activation:

Hexo server // or hexo SCopy the code

  • Write an essay:
hexo new "Content title"/ / or hexo n"Content title"
Copy the code



It then generates a Markdown post under source_posts, which opens with the editor and then writes the post.

  • Clear the cache file after writing an article
hexo clean
Copy the code
  • Then start the blog again:
hexo server
Copy the code

The blog is deployed on GitHub

To create a repository on GitHub, the repository name must be in the format of username.github

Such as:





  • An error occurs when you install the Git deployment plug-in in the blog folder
cnpm install --save hexo-deployer-git
Copy the code

  • Modify the configuration file _config.yml and fill in the address of the repository you just created
deploy:Type: git repo: https://github.com/xdr630/xdr630.github.io.git/branch/warehouse address: masterCopy the code

Commands deployed on Github:

Hexo deploy // or hexo dCopy the code



Then go directly to xdr630.github. IO

Change the theme:

Such as:

Github.com/litten/hexo…

https://github.com/xdr630/hexo-theme-icarus

I have cloned two themes locally:



Git clone /blog/themes/yilia

git clone https://github.com/litten/hexo-theme-yilia.git themes/yilia
Copy the code

Open the configuration file _config.yml and modify the theme

theme: yilia
Copy the code

Then clear the cache:

hexo clean
Copy the code

Rebuild:

Hexo generate // or Hexo GCopy the code

Access:



Deploy to Github:

Hexo deploy // or hexo dCopy the code

Access: xdr630. Making. IO



You can also change the theme of some CSS styles and so on.

Github Pages: xdr630.github. IO: yunxDr. Top: xdr630.github. IO: yunxDr. Top: github Pages: xdr630.github.Blog.csdn.net/qq_41684621…