搭建hexo博客遇到的问题

  1. 常用命令

    • hexo clean 清除hexo缓存
    • hexo generate 生成文章
    • hexo deploy 部署
    • hexo new post name 新建文章名
    • hexo new page name 新建页面名
    hexo clean && hexo generate && hexo deploy
    hexo cl && hexo g && hexo d
  2. deploy时git报错

    error:RPC failed;curl 56 OpenSSL SSL_read: Connectionwas reset,errno 10054

    SSL证书问题或者git中版本问题

    解决办法:

    • 删除掉.deploy_git重新clean、g、d
    • 挂代理
    • 删除掉本地的ssh key并重新生成,添加到github中
  3. 在文章中添加图片失败

    使用asset_img在文章中添加图片,需要修改_config.xml
    post_asset_folder: true

    asset_img在新建文章时会自动新建同名文件夹,需要添加图片时,只需将图片放入文件夹中,引入方式为:

    ![](test.png)

    引入后发现图片地址被解析为(.io/20/02/........),图片地址不正确,原因是asset未更新,导致遗留bug,修改 node_modules/hexo-asset-image/index.js,

    60行附近,

    // $(this).attr('src', config.root + link + src); //修改前
    $(this).attr('src',data.permalink+src); //修改后
    // console.info&&console.info("update link as:-->"+config.root + link + src);
    console.info&&console.info("update link as:-->"+data.permalink+src);
  4. md中插入数学公式问题
    • 安装kramed
    npm uninstall hexo-renderer-marked --save
    npm install hexo-renderer-kramed --save
    • 修改配置

      在_config.xml中添加
    kramed:
    gfm: true
    pedantic: false
    sanitize: false
    tables: true
    breaks: true
    smartLists: true
    smartypants: true
    • 修改主题配置文件
    mathjax:
    enable: true
    per_page: false

    enable:开启true

    per_page:是否选择每页都开启公式支持,true时,每篇文章都会引入mathjax.js,false时,需要引入时,需要在该文章fronter中写入mathjax:true,不需要引入时可减少加载资源。

    • 修改node_modules\kramed\lib\rules\inline.js

      在使用行间公式和行内公式会存在一些冲突,需要修改此文件
    //line11
    // escape: /^\\([\\`*{}\[\]()#$+\-.!_>])/,
    escape: /^\\([`*\[\]()#$+\-.!_>])/,
    //line20
    // em: /^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,
    em: /^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,

最新文章

  1. MySQL可视化软件Work Bench导出导入数据库
  2. Session中load/get方法的详细区别
  3. Apache Shiro系列教程之三:Shiro的结构
  4. 学习SQL的点点滴滴(一)-常用函数
  5. [BTS] BizTalk host BizTalkServerApplication throttled because DatabaseSize exceeded the configured throttling limit.
  6. Power Gating的设计(架构)
  7. dalvik虚拟内存管理之三——调试信息
  8. Oracle 物化视图创建
  9. 第九篇 ERP实施项目中需求分析及方案设计的通用思路
  10. Linux定时任务crontab每三秒执行一次shell
  11. iLearning D3.js 2.0 released
  12. github上值得研究的项目和人
  13. ruby中的模块
  14. vue安装element-ui和px2rem的细节
  15. 基于深度学习的目标检测技术演进:R-CNN、Fast R-CNN、Faster R-CNN
  16. Oracle sql function LISTAGG
  17. ABP EventBus(事件总线)
  18. jQuery入门基础(选择器)
  19. Unity3d之截图方法
  20. docker 实践

热门文章

  1. linux使用xampp安装MediaWiki环境
  2. RabbitMQ(二):交换机
  3. 将视图批量新增到PowerDesigner中并以model图表的形式展示
  4. 一、部署sqlserver
  5. samba网络共享
  6. system、 exec函数族、fork函数用法说明
  7. GridView控件使用
  8. sqlmap --eval 用法
  9. RSTP
  10. bash-completion linux命令补全