Hexo是一个基于Nodejs快速简洁高效的博客框架,Hexo使用Markdown语法来编辑文章,只须要几秒钟的时间就能够成生静态的网页。整个系统就是一个博客系统。html
npm install hexo-cli -g hexo init blog cd blog hexo server
而后打开http://localhost:4000/就能够查看效果了。注:
Hexo依赖Nodejs和Git,须要先安装。git
hexo generate = hexo g 生成静态博客,即从新生成public文件夹 hexo server = hexo s 本地预览调试 (通常组合使用 hexo g && hexo s) hexo delopy = hexo d (发布到github) hexo new = hexo n (执行该命令以后在source_posts目录下产生< blog name >.md文件,这是你的一篇新博客。能够在markdown工具下编写)
deploy: type: git repository: 你的仓库地址 branch: master
每一个账号只能有一个仓库来存放我的主页,并且仓库的名字必须是username/username.github.io,这是特殊的命名约定。github
npm install hexo-deployer-git --save hexo d -g (-g参数代表部署前,从新生成public目录)
而后就能够经过http://username.github.io来访问你的blog了。npm
本身使用的是阿里云,配置以下:
而后在hexo项目的source目录下新建一个文件CNAME
在CNAME中添加一行(本身购买的域名),注意不须要http://。服务器
www.sunnyxd.com
这样咱们就可使用域名访问本身的博客了。markdown
cd your-hexo-site git clone https://github.com/iissnan/hexo-theme-next themes/next
打开站点配置文件(your-hexo-site/_config.yml),增长一行:hexo
theme: next
进入your-hexo-site/themes/next,修改主题配置文件_config.yml scheme参数来选择本身喜欢的主题风格:app
scheme: Mist
注册多说,在站点配置文件_config.yml中增长:框架
duoshuo_shortname: your duoshuo shotname
开启多说分享:工具
duoshuo_share:true
开启多说热评:
duoshuo_hotartical:true
添加头像和Favicon
增长百度统计
增长阅读次数统计
添加分类、标签页面
设置RSS
添加侧边栏社交连接
开启打赏功能
以及更多设置内容及细节请参考nexT文档。
github的服务器在国外,百度没有办法抓取到。咱们能够把代码托管到国内的coding,另外还能够加快站点的访问速度。
deploy: type: git repository: github: 你的github仓库地址,master coding: 你的coding仓库地址,master
把coding的解析线路设成默认的,github设成国外的就行了。
一、在_config.yml添加 plugins: hexo-generator-sitemap sitemap: path: sitemap.xml baidusitemap: path: baidusitemap.xml 二、执行 npm install hexo-generator-sitemap --save npm install hexo-generator-baidu-sitemap --save 三、deploy d -g
ok,等待被百度收录吧~
在Github上搭建一个Hexo博客系统
hexo被百度收录方法
个人Hexo博客:sunnyxd' blog