参考文章链接:
这文章写得很具体 https://www.cnblogs.com/visugar/p/6821777.html
更换主题
可参考 https://www.jianshu.com/p/b7886271e21a
遇到的问题
1、 hexo安装成功,并且正确运行,但是localhost:4000不能访问
因为安装了福晰阅读器,端口被占用。。。 解决方案 :设置端口
hexo s -p 5000
参考:http://blog.csdn.net/u012246342/article/details/51543370
2、ERROR Deployer not found: git
安装
npm install --save hexo-deployer-git
3、make sure you have the correct access rights and the repository exist
由于GitHub没有添加SSH key
相关链接:http://blog.csdn.net/jingtingfengguo/article/details/51892864
如何写文章
hexo d
即可发布,并不需要用到git命令(脑子抽风时老是想着用git add)
参考:http://blog.csdn.net/qq_36099238/article/details/54576089
hexo文件目录
- _config.yml 全局配置文件
- package.json hexo框架的参数和所依赖插件
- scaffolds “骨架”的意思,新建文章时,hexo是根据这个目录下的文件进行构建
- source 新建文章保存在这个目录下
- themes 保存hexo主题
参考: https://www.jianshu.com/p/17d55d420d94
hexo常用命令
| 指令 | 简写 | 描述 |
|---|---|---|
| hexo new “PostName” | hexo n “PostName” | 新建文章 |
| hexo new page “PostName” | hexo n page “PostName” | 新建页面 |
| hexo clean | — | 清除之前public文件夹的内容 |
| hexo generate | hexo g | 生成静态页面至public目录 |
| hexo deploy | hexo d | 将.deploy目录部署到GitHub |
| hexo server | hexo s | 开启预览访问端口 |
| hexo help | — | 查看帮助 |
| hexo version | hexo v | 查看hexo版本号 |
其他指令:
hexo deploy -g 或者 hexo d –g 或 hexo g –d # 生成加部署
hexo server -g # 生成加预览