Hexo+Github/Gitee
Kang Lv3

一、Hexo框架

Hexo is a fast, simple and powerful blog framework.

Requirement

  • Node.js
  • Git
1
2
sudo apt-get install nodejs
sudo apt-get install git
  • 安装完成后,检查安装环境
1
2
node -v
git - version
  • 出现版本号即安装成功

安装Hexo

1
npm install -g hexo-cli
  • 安装完成后,初始化hexo,安装插件
1
2
3
hexo init MyBlog //MyBlog为你的博客文件夹,名字自定
cd MyBlog
npm install

以Mylog为根目录,打开终端,运行

1
2
3
hexo clean
hexo g
hexo s

会看到提示Hexo is running at http://localhost:4000,浏览器中打开即可本地预览
按下Ctrl+c即可停止服务

到此,本地博客搭建成功

二、Github/Gitee

注册 Github/Gitee

新建仓库

配置 SSHKey

部署到 Github

1
2
npm install hexo-deployer-git
hexo d

到此,博客部署完成

三、更改主题

到hexo官网https://hexo.io/themes/可以找到数百种主题
下载之后复制到theme文件夹下,并在_config.yml文件中更改主题名字

1
theme: keep
  • 本文标题:Hexo+Github/Gitee
  • 本文作者:Kang
  • 创建时间:2021-01-10 17:15:41
  • 本文链接:ykhou.github.io2021/01/10/Hexo-Github-Gitee/
  • 版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!