创建属于自己的博客
安装 hexo
必须先安装node
1234 打开git-bush,进入到一个合适的存放hexo的文件目录,直接运行http://www.xp510.com/xiazai/Application/other/28541.html使用npm先安装nodenpm install -g hexo-cli
注意安装时的错误提示
搭建博客
|
|
hexo init
cd blognpm install(自动安装所需要的全部插件)
hexo s
1 建立起本地的服务器,默认端口4000,打开浏览器,网址http://localhost:4000就可访问自己的博客
切换主题
hexo 官方提供了大量的优秀主题,我现在使用的是next主题,官网(http://theme-next.iissnan.com/ Next )
主题代码拷贝
主题的拷贝也是直接使用 git 即可,首先进入到你博客的根目录blog,再打开 git-bash 运行
1 git clone https://github.com/iissnan/hexo-theme-next themes/next
启用主题
在博客根目录下找到 _config.yml 文件,找到里面的 theme,改为next
发布博客到coding
配置 hexo deploy
hexo 提供了一个部署命令 hexo deploy,首先需要安装一下 hexo-deployer-git插件
1 npm install hexo-deployer-git --save
记得配置config.yml
配置统一资源定位符(个人域名)
url:http://inderstack.com
对于root(根目录)、permalink(永久链接)、permalink_default(默认永久链接)等其他信息保持默认配置部署
1234 deploy:type: gitrepo: https://github.com/bai1994/bai1994.github.io.gitbranch: master
bai1994这是我的域名,这里请填写自己的域名(域名自己定义,要求简短有意义,符合标准的驼峰命名)