hexo配合next在coding搭建博客

先来一波福利,就是给出我的博客下载地址(有mathjax……)
图片在huhaoo.coding.me里有,因为CSDN传图片太麻烦了

[百度网盘](链接: https://pan.baidu.com/s/1pLeEup1) 密码:mu87

CSDN

安装hexo

安装git和npm

这个不想说,自己去网上找

安装hexo

npm install hexo-cli -g

初始化博客

  • hexo init blog来初始化博客,就会出现这样:

  • 然后cd进入blogcd blog

  • 让后就是npm install

    这一步我也不知道有什么用。。。

    不过网上攻略有的步骤这样做(比如什么hexo ... install)会有奇效

  • 最后hexo shttp://localhost:4000/看看自己美丽~~陋~~的博客了(说真的初始主题好丑)

博客的初始配置

  • vim _config.yml 这样进入博客配置文件

    title: Huhao's home
    subtitle:
    description:
    author: Huhao
    language: zh-Hans
    timezone:

    开头我搞成了这样

    从上至下依次是:

    标题
    副标题
    描述
    作者
    语言
    时区

    然后在15行(应该是)的

    url: http://yoursite.com中填上域名

    最后在最后几行改成我这样

    deploy:
    type: git
    repo: https://git.coding.net/huhaoo/huhaoo.coding.me.git
    branch: master
    message: blog update

Next 主题初始化

  • git clone https://github.com/iissnan/hexo-theme-next themes/next

  • 根目录下_config 中的theme:landspacetheme: next

  • 可以hexo s一下看看

顺便给大家推荐以下更改:

  • vim themes/next/_config.yml

  • 
    # Schemes
    
    scheme: Muse
    
    #scheme: Mist
    
    
    #scheme: Pisces
    
    
    #scheme: Gemini
    

    改为

    
    # Schemes
    
    
    #scheme: Muse
    
    
    #scheme: Mist
    
    scheme: Pisces
    
    #scheme: Gemini
    
  • 
    # Canvas-nest
    
    canvas_nest: true
    
    
    # three_waves
    
    three_waves: false
    
    
    # canvas_lines
    
    canvas_lines: false
    
    
    # canvas_sphere
    
    canvas_sphere: false
    
    
    # Only fit scheme Pisces
    
    
    # Canvas-ribbon
    
    canvas_ribbon: true

    在某个地方(600行左右)有这个(5false

  • 再看看咋样了

写下一片博文

新建文章
  • 就是hexo n ......

写博文

  • 推荐Typoramoeditor

  • <hr />
    
    title: testlatex
    date: 2017-10-03 10:52:27
    tags:
    - test
    <hr />
    
    
    $x=\dfrac{-b\pm\sqrt{b^2-4ac}}{2a}$
  • 欣喜交加接了片博文,看了看:

    What???

Mathjax

  • 良心的next已经为我们准备好了,只要:

    mathjax:
    enable: false
    per_page: false
    cdn: //cdn.bootcss.com/mathjax/2.7.1/latest.js?config=TeX-AMS-MML_HTMLorMML

    改为

    mathjax:
    enable: true
    per_page: true
    cdn: //cdn.bootcss.com/mathjax/2.7.1/latest.js?config=TeX-AMS-MML_HTMLorMML

    就好了

  • BUT

  • 点进去就挂了QAQ

  • 于是,每次写文章就更麻烦了

  • mathjax: on

  • 每次都要写

  • 不过美丽的mathjax就出来了

其它美丽的配置

单击爱心
  • vim themes/next/source/js/src/love.js然后输入以下代码

    !function(e,t,a){function n(){c(".heart{width: 10px;height: 10px;position: fixed;background: #f00;transform: rotate(45deg);-webkit-transform: rotate(45deg);-moz-transform: rotate(45deg);}.heart:after,.heart:before{content: '';width: inherit;height: inherit;background: inherit;border-radius: 50%;-webkit-border-radius: 50%;-moz-border-radius: 50%;position: fixed;}.heart:after{top: -5px;}.heart:before{left: -5px;}"),o(),r()}function r(){for(var e=0;e<d.length;e++)d[e].alpha<=0?(t.body.removeChild(d[e].el),d.splice(e,1)):(d[e].y--,d[e].scale+=.004,d[e].alpha-=.013,d[e].el.style.cssText="left:"+d[e].x+"px;top:"+d[e].y+"px;opacity:"+d[e].alpha+";transform:scale("+d[e].scale+","+d[e].scale+") rotate(45deg);background:"+d[e].color+";z-index:99999");requestAnimationFrame(r)}function o(){var t="function"==typeof e.onclick&&e.onclick;e.onclick=function(e){t&&t(),i(e)}}function i(e){var a=t.createElement("div");a.className="heart",d.push({el:a,x:e.clientX-5,y:e.clientY-5,scale:1,alpha:1,color:s()}),t.body.appendChild(a)}function c(e){var a=t.createElement("style");a.type="text/css";try{a.appendChild(t.createTextNode(e))}catch(t){a.styleSheet.cssText=e}t.getElementsByTagName("head")[0].appendChild(a)}function s(){return"rgb("+(255*Math.random())+","+(255*Math.random())+","+~~(255*Math.random())+")"}var d=[];e.requestAnimationFrame=function(){return e.requestAnimationFrame||e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||e.oRequestAnimationFrame||e.msRequestAnimationFrame||function(e){setTimeout(e,1e3/60)}}(),n()}(window,document);

  • vim themes/next/layout/_layout.swig

    在末尾添加:<script type="text/javascript" src="/js/src/love.js"></script>

添加顶部加载条
  • vim themes/next/layout/_partials/head.swig

  • <script src="//cdn.bootcss.com/pace/1.0.2/pace.min.js"></script>
    <link href="//cdn.bootcss.com/pace/1.0.2/themes/pink/pace-theme-flash.css" rel="stylesheet">
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值