[关闭]
@chenlai89 2015-08-16T15:09:27.000000Z 字数 1625 阅读 1236

hexo 网站建设

网站建设


第一部分 安装 hexo

  1. npm install -g hexo-cli

node js 安装参考

新建博客目录

  1. hexo init blog

打开目录 blog, 然后运行

  1. npm install

基本完成,之后可以选择写文章,或者预览demo
写文章则运行,生成markdown文件,在source/_post/

  1. hexo new file-name
  2. hexo new page page-name // 生成新的界面

预览则运行

  1. hexo server

第二部分 个性化配置

以上几个项目基本可满足需求,当然还可以深度配置一些内容。

我使用的主题:
主题 Tranquilpeak

下载好后放到主题的目录底下

更改头像
picture: /assets/images/touxiang.png

网站图片
cover_image: http://7xkzbi.com1.z0.glb.clouddn.com/v1.3.0-cover.jpg

作者信息更改:

  1. author:
  2. email: laihub@163.com
  3. location: HangZhou
  4. # Your profile picture located in folder `source/_images/` (development)
  5. # or in `source/assets/images/` (production).
  6. # Overwritten by your gravatar image if `gravatar_image` is enabled
  7. picture: http://7xkzbi.com1.z0.glb.clouddn.com/touxiang.jpg
  8. # Your Twitter username without the @. E.g : `tranquilpeak`
  9. twitter:
  10. # Your google plus profile id. E.g : `+Tranquilpeak` or `123812884128439`
  11. google_plus:

搜索添加
1. 到swiftype网站上注册
2. 添加域名,然后一步步操作,配置搜索标题类型,显示内容数量等信息,最后激活。
3. 复制 下面 4tEc1-hSwtuX_4ZRi3QR 到 主题

  1. <script type="text/javascript">
  2. (function(w,d,t,u,n,s,e){w['SwiftypeObject']=n;w[n]=w[n]||function(){
  3. (w[n].q=w[n].q||[]).push(arguments);};s=d.createElement(t);
  4. e=d.getElementsByTagName(t)[0];s.async=1;s.src=u;e.parentNode.insertBefore(s,e);
  5. })(window,document,'script','//s.swiftypecdn.com/install/v2/st.js','_st');
  6. _st('install','4tEc1-hSwtuX_4ZRi3QR','2.0.0');
  7. </script>

最后就是要添加几个page 文件
运行

  1. picture: 11.jpg
  2. gravatar_email: #chenlai89@gmail.com

Disqus 注册

https://help.disqus.com/customer/portal/articles/466208
注册 后获取shortname

  1. disqus_shortname: chenlai

http://7xkzbi.com1.z0.glb.clouddn.com/v1.3.0-cover.jpg

google analyse

建议的服务器网站

DNSPod, CloudFlare
//res.cloudinary.com

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注