Git source Demo: www.kunlingou.club

Set up

  • Github builds static sites (no server purchase required)

Initial Blog environment

cnpm i -g hexo-cli
hexo init
cnpm install
Copy the code

Configuring Blog Parameters

./_config.yml

// Deploy (commit) mode
# Deployment
## Docs: https://hexo.io/docs/deployment.html
deploy:
  type: git
  repo: [email protected]:kunlingou/kunlingou.github.io.git
  branch: master

hexo s // Start the service
Copy the code

Deploy (commit to Git)

cnpm i -S hexo-deployer-git
hexo clean
hexo g -d// Generate hexo deployCopy the code

Correlation domain name

  • Refer to Github to build a static website (no need to buy a server)
  • Create a CNAME file
. /source/CNAME

www.kunlingou.club
Copy the code
  • Deploy the service

The problem

  1. Don’t have access togoogleapisA link to thejquery.min.js

    .\themes\landscape\layout\_partial\after-footer.ejs

    ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.jsReplace withlibs.baidu.com/jquery/2.0.3/jquery.min.js.

hexo clean
hexo g -d
Copy the code
  1. Topic (NexT) Reference Document: official documentation
./

git clone https://github.com/theme-next/hexo-theme-next themes/next

./_config.yml

# Extensions
## Plugins: https://hexo.io/plugins/
## Themes: https://hexo.io/themes/
# theme: landscape
theme: next
Copy the code
  • next

    git clone https://github.com/theme-next/hexo-theme-next themes/next

use

Hexo common command

hexo n "XXX"// create a new article hexo g-d// Generate static file, deploy hexo s // start local server hexo clean // clear cache file db.json and generate file./ /public/Copy the code

option

Hexo --safe // Safe mode hexo --debug // Debug mode hexo --silent // Silent modeCopy the code