本文共 2156 字,大约阅读时间需要 7 分钟。
$ ssh-keygen -t rsa -C "000000@qq.com" //填写github邮箱
$ git config --global user.name "joinbobo"
$ git config --global user.email "000000@qq.com"
Repository name //仓库的名字
Description //对仓库的功能进行一个简要的概述 public //开源,免费,你的仓库将会是公共仓库,任何人都能访问你的仓库、fork。 private //闭源,收费,你的仓库将会是私密仓库。 initialize this repository with a README //为你的仓库创建一个说明文档,也就是使用说明书,方便别人的阅读。 Add.gitgnore //你的仓库里代码主要使用的语言,或者你的仓库主要关于那个语言方面的知识。 Add a license //为你的仓库加一个开源证书,如果你仅仅想保留著作权/版权,那就选 **MIT License .
Node.js 下载地址: //傻瓜式安装
> npm config set registry https://registry.npm.taobao.org
> npm config get registry //返回https://registry.npm.taobao.org,说明镜像配置成功。
> npm install -g cnpm --registry=https://registry.npm.taobao.org
$ cnpm install -g hexo-cli
-g代表全局安装,hexo后的 -cli 代表命令行
$ hexo init
(Ps:一定是在空的文件夹里初始化)$ hexo new my first blog
$ hexo s
npm install hexo-deployer-git --save
deploy: type: git repository: https://github.com/joinbobo/joinbobo.github.io.git branch: master
参数 | 描述 |
---|---|
repository | 库地址(也可以简写“repo") |
branch | 分支名称,如果使用的是 GitHub 或 GitCafe 的话,程序会尝试自动检测。 |
$ hexo server
$ hexo clean //清除缓存(删除public文件夹)$ hexo generate //生成静态文件 可以简写 hexo g$ hexo deploy //将本地文件(public目录)推送至GitHub 可以简写 hexo d
部署成功后,浏览器地址输入“用户名.github.io”,便可浏览个人博客!
Hexo切换主题
$ git clone <url>
添加导航栏功能页面
$ hexo new page "about"
添加搜索功能:
去除页脚logo
推荐主题:
两大主流静态框架:Jekyll + Hexo
参考文献:
转载地址:http://vnqen.baihongyu.com/