gitee and hexo build a personal blog

First prepare the software:

  1. git (provide the command git)
  2. notepad++ (easy to edit)
  3. nodejs (hexo dependency

installation

The installation process of nodejs, git, notepad++ is omitted. The main thing to talk about is the installation and configuration of hexo.

Win+R-> 'cmd' 打开命令行

First, you need to configure the domestic source of npm

npm config set registry https://registry.npm.taobao.org		#配置国内的镜像源
cnpm info hexo	# 测试查看hexo的安装信息,是否是taobao.org的源

Then install hexo:

cnpm install -g hexo 		# 通过npm安装hexo
-g specifies global installation, you can use the hexo command

Initial creation, tBlog folder will be created on the desktop

hexo init blog		# 初始化
cd blog				# 进入blog目录
npm install			# 进一步安装hexo所需文件	

Then the hexo installation is complete, and then you can start hexo

hexo clean			# 清除所有记录
hexo generate		# 生成静态网页
hexo server 	# 启动服务

Then use a browser to visit http://localhost:80
Insert picture description here

Theme configuration

If you don’t like this theme, you can change it

For example, the next theme, https://hexo.io/themes/ , go to github to download the compressed package and put it in the themes directory under the blog

Then configure _config.yml

# Extensions
## Plugins: https://hexo.io/plugins/
## Themes: https://hexo.io/themes/
## theme: landscape

theme: hexo-theme-clean-blog #主题

Then restart the hexo service

hexo clean			# 清除所有记录
hexo generate		# 生成静态网页
hexo server 	# 启动服务

Then revisit the page, it will change (modified page)

http://localhost:4000

Insert picture description here


This step can be used after the final build is successful

Post a blog:

Create locally and then publish to gitee remote

hexo new "文章名"   然后你会在你的blog/source/_posts下看到

Upload to gitee

As for why github is not used but gitee is used, the main reason is that the github server is foreign and the access effect is not good.

gitee homepage

Then gitee create your own account, and then create your own warehouse
Insert picture description here

After the warehouse is created, enter the warehouse

Insert picture description here
Copy the URL to the configuration file _config.yml of hexo

deploy:
  type: git     #上传方式
  repo: https://gitee.com/woshifanlan/blog.git
  branch: master

Install a hexo plugin

npm install hexo-deployer-git --save	# 安装git插件

Upload theme file

hexo clean			# 清除所有记录
hexo generate		# 生成静态网页
hexo deploy	# 上传到gitee

When uploading, you need to re-enter the registered email address of gitee as the username and the account password as the password

Then check the gitee warehouse and there will be uploaded files:
Insert picture description here
visit Gitee Pages service, website address: https://woshifanlan.gitee.io/blog

Insert picture description here
The personal blog is now set up


I am a flood blog

https://woshifanlan.gitee.io/blog/

Welcome to view

Guess you like

Origin blog.csdn.net/weixin_45627031/article/details/108357330