首先在github上注册一个账号,然后在界面找到菜单按钮New reposition点击进去,在Repository name里面输入自己合适的地址
然后安装node,git,适合自己的编辑器,如:sublime
安装git
在合适的目录下安装git一直next;在计划创建博客文件目录下执行配置文件
1 |
|
把github上的项目克隆在本地创建新的文件夹下:
1 | git clone Your site address... |
然后在本地项目文件里把hexo主题克隆下来,和你在github上的项目放在同一等级位置
1 | git clone https://github.com/iissnan/hexo-theme-next themes/next |
安装hexo
1 | npm install hexo-cli -g |
初始化
1 | hexo init |
安装依赖和插件
1 | npm install |
启动服务查看
1 | 启动服务器本地查看 浏览器地址输入:localhost:4000,就能本地预览 |
模板配置
hexo模板配置,详情预览官方API手册:http://theme-next.iissnan.com/getting-started.html
创建分类
1 | hexo new page "categories" |
然后再categories文件里添加属性 type: categories就可以设置分类
创建标签
1 | hexo new page "tags" |
然后再tags文件里添加属性 type: tags就可以设置标签
hexo使用命令
1 | hexo n "我的博客" == hexo new "我的博客" #新建文章 |
注意
hexo使用中的问题:hexo部署提示找不到git,解决方法执行
1 | npm install hexo-deployer-git --save |
git pull 提示fatal: Could not read from remote repository,执行:
1 | git remote add origin your-github-url |
关于更多hexo语法,这个问下度娘 ^_^