Goal
This documentation is to introduce how to build your personal blog by Git and Hexo.
Installation
Git
NPM
NPM is the package manager for Node.
1 2
| brew install npm npm config set registry https://registry.npm.taobao.org
|
Hexo
Hexo is an open source, convenient framework to help you quickly build your blog.
1 2
| npm install hexo-cli -g npm install hexo-deployer-git --save
|
Post blog Steps
Initialization Hexo
1 2 3 4
| hexo init myblog<your project name> cd myblog npm install export PATH=$PATH:~/.nvm/versions/node/v12.16.0/bin
|
Create new page
1 2
| hexo new "MyFirstBlog"<your blog name> # write your blog through *.md file.
|
Restart
1
| hexo clean && hexo deploy
|
Onboard Google Search Console
- Go to the Search Console Page.
- Paste your url at
URL prefix
.
- Download the Html file.
- Put the download Html file under
source
directory.
- Add the
layout
Head as below: 1 2 3 4 5
| --- layout: false ---
google-site-verification: google03c774646bdb5e4a.html
|
hexo d -g
- Verify at the Google Search Console.
Add SiteMap
Sitemap is to a file(Xml,etc.) to tell GoogleSeaqrchEnginte
the structure information about the website.
Generate the Sitemap file
The tool.
1
| $ npm install hexo-generator-sitemap --save
|
Modify themes/next_config.yml
:
1 2 3 4 5 6 7 8 9
| menu: home: / || home #about: /about/ || user tags: /tags/ || tags categories: /categories/ || th archives: /archives/ || archive #schedule: /schedule/ || calendar sitemap: /sitemap.xml || sitemap #commonweal: /404/ || heartbeat
|
Restart
Add the sitemap to google
- By web:
http://www.google.com/webmasters/tools/
- By command line:
curl https://www.google.com/ping?sitemap=https://opsmilesum.github.io/sitemap