Build a blog hexo

Installation depends Environment

  • git
  • asl
  • nodejs

Install git

sudo apt install git

Install npm

sudo apt install npm

Installation nodejs

sudo apt install nodejs

Installation Hexo

npm install -g hexo-cli

hexo use

hexo init folder

Initialize a folder as your blog

hexo new file

File.md a new file in / folder / source / _posts / path

hexo s

Open the local preview, at http: // localhost: 4000 Preview blog

Modify Hexo theme

You can Themes | Hexo download your favorite theme, the theme will be downloaded folder to the /folder/themes/next

git clone theme's site

You can add about, tags, categories, contact and other information:

hexo new page about
hexo new page tags
hexo new page categories
hexo new page contact

Modify /folder/_config.ymlreplace the complete theme

theme: your theme

In /folder/themes/your themethe option to configure your theme style, if you will CSS, you can modify the style template theme

Deployed to the distal github

Add your github information

git config --global user.name "yourname"
git config --global user.email "youremail"

Creating ssh

ssh-keygen -t rsa -C "youremail"

In the ~/.ssh/presence of folders id_rsaand id_rsa.pubtwo files, which id_rsa.pubis a public key, copy and paste it onto github:

  • setting > SSH and GPG keys > New SSH key - Paste

Installation deploy-git

npm install hexo-deployer-git --save

Modify /folder/_config.yml file:

deploy:
  type: 'git'
  repo: https://github.com/yourGithub/yourGithub.github.io.git
  branch: master

Pushed to the distal end

hexo d
  • By hexo cleanbefore you can clear generated content
  • By hexo ggenerating static blog

Please refer to more tutorials Documentation | Hexo


Attach my hexo blog

Published 44 original articles · won praise 19 · views 20000 +

Guess you like

Origin blog.csdn.net/l_changyun/article/details/104089004