一,环境准备

搭建之前需要准备的软件: Git:官网下载:git-scm.com Node.js 官网下载:nodejs.cn

要是慢的话可以使用我分享的文件这里不保证是最新的。

检查:

1
2
npm
git -v

二, 安装hexo-cli

安装hexo-cli

进入cmd窗口输入指令:

1
npm install -g hexo-cli

如果时间太长或无法下载,

推荐用淘宝的npm分流——cnpm 安装过程很简单: npm install -g cnpm --registry=https://registry.npm.taobao.org

三, 安装Hexo

进入cmd窗口输入指令:

1
hexo init 你存放Hexo博客的路径如C:\blog

tip: 太慢解决方案

翻译源码换gitee源

1
2
3
4
5
6
git clone https://gitee.com/weilining/hexo-starter.git blog-path
cd blog-path
git submodule init
git submodule update
npm config set registry http://registry.npm.taobao.org
npm install
1
hexo s

启动成功就代表你成功安装了Hexo,在浏览器输入http://localhost:4000/

界面如下:

Ctrl+C可以停止本地服务器

Hexo部署到Github

安装插件hexo-deployer-git并完成相关配置

1
npm install hexo-deployer-git --save

_config.yml中编辑

1
2
3
4
deploy: 
type: git
repo: #你的仓库地址,如git@github.com:xxx/xxx.github.io.git
branch: main #也可以是master

生成静态文件

1
hexo g

部署到Github仓库上(前提是建立了该仓库)

查看博客

现在简单的博客已经搭建完成了 现在你的个人网站的地址是 xxx.github.io

更改主题

原配的的主题实在是太丑了。

Themes | Hexo中寻找你心意的主题。这里推荐几个主题

  1. Butterfly - A Simple and Card UI Design theme for Hexo
  2. 介绍 | Hexo Aurora (tridiamond.tech)
  3. NexT 使用文档 (iissnan.com)
  4. theme-nexmoe/hexo-theme-nexmoe: 🔥 一个比较特别的 Hexo 主题 (github.com)
  5. JoeyBling/hexo-theme-yilia-plus: 一个简洁优雅的hexo主题 A simple and elegant theme for hexo. (github.com)
  6. fluid-dev/hexo-theme-fluid: 一款 Material Design 风格的 Hexo 主题 / An elegant Material-Design theme for Hexo (github.com)

博主曾用过NexT,fluid,butterfly(按时间顺序)。

自然想要完全符合自己的喜好,要自己去魔改主题了(要不自己可以开发一个主题,逃ε=ε=ε=┏(゜ロ゜;)┛)