Hexo 搭建:搭建与配置

.... 下边不截图了反正就是一路 Next 除了一个路径自选!!!检查是否安装成功可以在桌面右键看一下!!!

3.下载安装 hexo?
以下两种方法二选一,那种都可以!!!下方仅演示第一种!!!
首先 Win + R 输入 Cmd 用管理员权限运行 然后输入 npm install -g hexo(网上说要翻墙,但是我没翻墙也能下载)
或者也可以用这种方法,在桌面创建一个文件夹,右键打开 GitBashHere,输入安装命令 npm i -g hexo?

检查是否安装成功 可以输入 hexo --version?

初始化 hexo init 之后会在这个文件夹里创建很多文件

运行 hexo server 默认访问的网址应该是 localhost:4000 终止是 Ctrl + c?


这个地方可能会有异常出现,反正我是碰到了
例如运行 hexo server 提示找不到命令
解决方案
方案一??可以尝试执行一下 npm install hexo-server --save
方案二??给他指定安装一个目录 hexo init C:/hexo 然后 cd 到目录 npm install 进行安装
搭桥到 GitHub?
创建库 New repository 名称,一定要记得加 xxx.github.io 主要的是 .github.io
最后别忘了勾选 Initialize this repository with a README
然后点击创建 Create Repository ,注意!!!! 创建库的时候需要说一下,尽量按照自己的用户名来!!! 切记!!!


配置 GitHub 信息
打开刚刚创建的文件夹,找到 _config.yml 文件
添加上这一段代码??
deploy:
type: git
repository: https://github.com/linluochen/linluochen.github.io.git
branch: master
保存并关闭文件,然后执行以下命令?
运行:npm install hexo-deployer-git --save
运行:hexo g(本地生成静态文件 Public 目录)还有一个 hexo clean 删除本地静态文件(Public 目录)可不执行
运行:hexo d(将本地静态文件推送至 Github)
更换主题模版 Next 模板
在 Git Bash 中 cd 博客路径,然后下载模版主题 git clone https://github.com/theme-next/hexo-theme-next themes/next?
评论