Build blog web using hexo, github and cloudflare

利用hexo库构建博客模板 Ultilize hexo lib to build blog

Refer from:https://hexo.io/zh-cn/index.html

install node.js from https://nodejs.org/en

install hexo:

1
2
3
$ npm install hexo-cli -g
$ hexo init blog
$ npm install

add new blog:

1
hexo new [layout] <title>

configure the themes:

1
2
3
theme: land
theme_config:
banner: "images/banner.png"

利用github存储博客生成文件 Ultilize Github to storage blog building file

1.Create a repository on Github
2.git remote add origin <repository_link>
3.git push -u origin master
4.git push -u origin <branch-name>

利用Cloudflare托管并自动生成网页文件 Ultilize Cloudeflare to host and automatically generate web page files

1.Sign up Cloudflare and enter the dashboard
2.Enter Worker&Pages section
3.Create application –> Pages –> Connect to Git
4.Set Environment variables NODE_VERSION = {Current using node version}
5.Set Build configurations Build command = npx hexo generate Build output directory = /public

custom domain

1.Buy a domain on NameSilo
2.Set domain name servers to love.ns.cloudflare.com, trevor.ns.cloudflare.com for Cloudflare to host
3.Set domain host in Cloudflare dashboard –> website
4.Set custom domains in Cloudflare dashboard –> Pages