Create a new blog

Windows系统使用Gitee仓库和Hexo创建一个可以通过网络访问的博客,如有问题请联系Zichen学习交流

安装环境

安装git

git官网:https://git-scm.com/

安装node

node官网:https://nodejs.org/

安装Hexo

Hexo官网:https://hexo.io/

创建文件

创建Gitee仓库

Gitee官网:https://gitee.com/

创建Hexo本地仓库

$ hexo init <folder>
$ cd <folder>
$ npm install

部署博客

部署到Gitee仓库

安装hexo-deployer-git

$ npm install hexo-deployer-git --save

修改配置文件_config.yml

deploy:
  type: git
  repo: <repository url> #https://bitbucket.org/JohnSmith/johnsmith.bitbucket.io
  branch: [branch]
  message: [message]

生成站点文件并推送至远程库

$ hexo clean
$ hexo deploy

写文章

创建新的文章

$ hexo new [layout] <title>

本地运行

安装hexo-server

$ npm install hexo-server --save

启动服务器

$ hexo server

上传仓库

清除静态文件

$ hexo clean

生成静态文件

$ hexo generate

上传静态文件

$ hexo deploy

End.

谢谢您的阅读!

Copyright 2022 Zichen

Licensed under the Apache License, Version 2.0 (the “License”);
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an “AS IS” BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.