Hexo 入门

hexo的下载和安装

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
常用命令:
hexo new post “博客名” #创建
hexo d -g #发布
hexo s --debug #测试界面

hexo new "postName" #新建文章
hexo new page "pageName" #新建页面
hexo generate #生成静态页面至public目录
hexo server #开启预览访问端口(默认端口4000,'ctrl + c'关闭server)
hexo deploy #部署到GitHub
hexo help # 查看帮助
hexo version #查看Hexo的版本

清除缓存的方法:
- 执行命令:hexo clean
- 然后可以生成静态博客并在本地预览:hexo g & hexo s

1、利用 npm 命令即可安装。在任意位置点击鼠标右键,选择Git Bash输入命令:npm install -g hexo
2、创建文件夹(我的是在E盘创建的Hexo),然后在Hexo文件下,右键运行Git Bash,输入命令:hexo init在_config.yml,进行基础配置

部分报错
1.找不到git部署 ERROR Deployer not found: git
解决方法
npm install hexo-deployer-git –save
3.部署类型设置git
hexo 3.0 部署类型不再是github,_config.yml 中修改

Deployment

Docs: http://hexo.io/docs/deployment.html

deploy:
type: git
repository: git@.github.com:/***.github.io.git
branch: master

  1. xcodebuild
    xcode-select: error: tool ‘xcodebuild’ requires Xcode, but active developer directory ‘/Library/Developer/CommandLineTools’ is a command line tools instance
    npm install bcrypt
  2. RSS不显示
    安装RSS插件
    npm install hexo-generator-feed –save
    开启RSS功能
    编辑hexo/_config.yml,添加如下代码: