<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>唐某某的blog</title>
  
  <subtitle>一切都是代码</subtitle>
  <link href="https://engining.net/atom.xml" rel="self"/>
  
  <link href="https://engining.net/"/>
  <updated>2022-08-05T01:03:18.835Z</updated>
  <id>https://engining.net/</id>
  
  <author>
    <name>tangshd</name>
    
  </author>
  
  <generator uri="https://hexo.io/">Hexo</generator>
  
  <entry>
    <title>MAC环境下使用hexo遇到的问题</title>
    <link href="https://engining.net/2022/08/05/%E4%BD%BF%E7%94%A8hexo%E4%B8%AD%E7%9A%84%E9%81%87%E5%88%B0%E7%9A%84%E9%97%AE%E9%A2%98/"/>
    <id>https://engining.net/2022/08/05/%E4%BD%BF%E7%94%A8hexo%E4%B8%AD%E7%9A%84%E9%81%87%E5%88%B0%E7%9A%84%E9%97%AE%E9%A2%98/</id>
    <published>2022-08-05T07:54:53.000Z</published>
    <updated>2022-08-05T01:03:18.835Z</updated>
    
    <content type="html"><![CDATA[<p>因俗事缠身，很久未写博客了，最近有了点空闲，想把博客倒腾一下重新拉起来。<br>开干！</p><p>经过一番折腾，终于搞定，期间遇到一些问题记录下来，以便查询：</p><h2 id="当前环境"><a href="#当前环境" class="headerlink" title="当前环境"></a>当前环境</h2><p>系统： macOS Monterey<br>node: v18.6.0<br>npm:8.13.2<br>hexo-cli: 4.3.0<br>os: darwin 21.5.0 12. </p><h2 id="遇到的问题"><a href="#遇到的问题" class="headerlink" title="遇到的问题"></a>遇到的问题</h2><h3 id="1、node-sass-无法正常使用"><a href="#1、node-sass-无法正常使用" class="headerlink" title="1、node-sass 无法正常使用"></a>1、node-sass 无法正常使用</h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">at module.exports (/Users/tangshd/WorkSpace/private/engining.net/node_modules/hexo-renderer-sass/node_modules/node-sass/lib/binding.js:13:13)</span><br></pre></td></tr></table></figure><ul><li>解决方案：<br>nodejs + npm 降级到14.7.0<br>安装nvm 0.39.1 后， nvm use 14.7.0</li></ul><h3 id="2、主题不兼容，hexo-g出现错误"><a href="#2、主题不兼容，hexo-g出现错误" class="headerlink" title="2、主题不兼容，hexo g出现错误"></a>2、主题不兼容，hexo g出现错误</h3><p>hexo主题参考手册：<a href="https://hexo.io/zh-cn/docs/themes">https://hexo.io/zh-cn/docs/themes</a></p><ul><li>解决方案：<br>推荐使用人数较多、更新比较及时的主题，比如pure、fluid等</li></ul><h3 id="3、-hexo-d-后，githupage-丢失重定向的域名"><a href="#3、-hexo-d-后，githupage-丢失重定向的域名" class="headerlink" title="3、 hexo d 后，githupage 丢失重定向的域名"></a>3、 hexo d 后，githupage 丢失重定向的域名</h3><ul><li>解决方案：<br>在source 根目录下新建CNMAE文件，然后在文件内填入域名，重新hexo d</li></ul>]]></content>
    
    
      
      
    <summary type="html">&lt;p&gt;因俗事缠身，很久未写博客了，最近有了点空闲，想把博客倒腾一下重新拉起来。&lt;br&gt;开干！&lt;/p&gt;
&lt;p&gt;经过一番折腾，终于搞定，期间遇到一些问题记录下来，以便查询：&lt;/p&gt;
&lt;h2 id=&quot;当前环境&quot;&gt;&lt;a href=&quot;#当前环境&quot; class=&quot;headerlink&quot; ti</summary>
      
    
    
    
    <category term="hexo" scheme="https://engining.net/categories/hexo/"/>
    
    
    <category term="nvm" scheme="https://engining.net/tags/nvm/"/>
    
    <category term="node npm" scheme="https://engining.net/tags/node-npm/"/>
    
  </entry>
  
  <entry>
    <title>how to use hexo theme - pure</title>
    <link href="https://engining.net/2022/07/24/how-to-use-hexo-pure%20/"/>
    <id>https://engining.net/2022/07/24/how-to-use-hexo-pure%20/</id>
    <published>2022-07-24T04:54:53.000Z</published>
    <updated>2022-08-03T11:16:14.100Z</updated>
    
    <content type="html"><![CDATA[<h1 id="pure"><a href="#pure" class="headerlink" title="pure"></a>pure</h1><p>A brand new default theme for [<a href="https://hexo.io/">Hexo</a>]. </p><h2 id="特色"><a href="#特色" class="headerlink" title="特色"></a>特色</h2><ul><li>多语言</li><li>第三方评论框（友言、来必力、gitment、gitalk）</li><li>可展示个人豆瓣书单</li><li>可展示个人github托管项目</li><li>可设置支付宝、微信打赏</li></ul><h2 id="主题颜色"><a href="#主题颜色" class="headerlink" title="主题颜色"></a>主题颜色</h2><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">config:</span><br><span class="line">  skin: theme-black # 主题颜色 theme-black theme-blue theme-green theme-purple</span><br></pre></td></tr></table></figure><h2 id="页面展示"><a href="#页面展示" class="headerlink" title="页面展示"></a>页面展示</h2><p><a href="http://cofess.github.io/">首页</a> | <a href="http://cofess.github.io/archives/">归档</a> | <a href="http://cofess.github.io/categories/">分类</a> | <a href="http://cofess.github.io/tags/">标签</a> | <a href="http://cofess.github.io/repository/">项目</a> | <a href="http://cofess.github.io/books/">书单</a> | <a href="http://cofess.github.io/links/">友链</a> | <a href="http://cofess.github.io/about/">关于</a></p><h2 id="配置说明"><a href="#配置说明" class="headerlink" title="配置说明"></a>配置说明</h2><p>在 Hexo 中有两份主要的配置文件，其名称都是 _config.yml。 其中，一份位于站点根目录下，主要包含 Hexo 本身的配置；另一份位于主题目录下，这份配置由主题作者提供，主要用于配置主题相关的选项。为了描述方便，在以下说明中，将前者称为站点配置文件， 后者称为主题配置文件</p><h2 id="安装主题"><a href="#安装主题" class="headerlink" title="安装主题"></a>安装主题</h2><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git clone https://github.com/cofess/hexo-theme-pure.git themes/pure</span><br></pre></td></tr></table></figure><h2 id="更新主题"><a href="#更新主题" class="headerlink" title="更新主题"></a>更新主题</h2><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">cd themes/pure</span><br><span class="line">git pull</span><br></pre></td></tr></table></figure><h2 id="启用pure主题"><a href="#启用pure主题" class="headerlink" title="启用pure主题"></a>启用pure主题</h2><p>打开站点配置文件，找到theme字段，将其值更改为 pure</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">theme: pure</span><br></pre></td></tr></table></figure><p>到此，主题安装完成。然后启动Hexo服务验证主题是否正确启用。</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo s</span><br></pre></td></tr></table></figure><h2 id="安装插件"><a href="#安装插件" class="headerlink" title="安装插件"></a>安装插件</h2><h3 id="hexo-wordcount"><a href="#hexo-wordcount" class="headerlink" title="hexo-wordcount"></a><a href="https://github.com/willin/hexo-wordcount">hexo-wordcount</a></h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install hexo-wordcount --save</span><br></pre></td></tr></table></figure><h3 id="hexo-generator-json-content"><a href="#hexo-generator-json-content" class="headerlink" title="hexo-generator-json-content"></a><a href="https://github.com/alexbruno/hexo-generator-json-content">hexo-generator-json-content</a></h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install hexo-generator-json-content --save</span><br></pre></td></tr></table></figure><h3 id="hexo-generator-feed"><a href="#hexo-generator-feed" class="headerlink" title="hexo-generator-feed"></a><a href="https://github.com/hexojs/hexo-generator-feed">hexo-generator-feed</a></h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install hexo-generator-feed --save</span><br></pre></td></tr></table></figure><h3 id="hexo-generator-sitemap"><a href="#hexo-generator-sitemap" class="headerlink" title="hexo-generator-sitemap"></a><a href="https://github.com/hexojs/hexo-generator-sitemap">hexo-generator-sitemap</a></h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install hexo-generator-sitemap --save</span><br></pre></td></tr></table></figure><h3 id="hexo-generator-baidu-sitemap"><a href="#hexo-generator-baidu-sitemap" class="headerlink" title="hexo-generator-baidu-sitemap"></a><a href="https://github.com/coneycode/hexo-generator-baidu-sitemap">hexo-generator-baidu-sitemap</a></h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install hexo-generator-baidu-sitemap --save</span><br></pre></td></tr></table></figure><h2 id="主题配置"><a href="#主题配置" class="headerlink" title="主题配置"></a>主题配置</h2><h3 id="设置语言"><a href="#设置语言" class="headerlink" title="设置语言"></a>设置语言</h3><p>打开站点配置文件, 将 language 设置成你所需要的语言。建议明确设置你所需要的语言,可选值对应themes\pure\languages目录下语言文件，简体中文配置如下：</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">language: zh-CN</span><br></pre></td></tr></table></figure><h3 id="主题颜色-1"><a href="#主题颜色-1" class="headerlink" title="主题颜色"></a>主题颜色</h3><p>定制了五套颜色，默认白，黑:theme-black，蓝:theme-blue，绿:theme-green，紫:theme-purple</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"># config</span><br><span class="line">config:</span><br><span class="line">  skin: # 主题颜色 theme-black theme-blue theme-green theme-purple</span><br></pre></td></tr></table></figure><h3 id="导航菜单"><a href="#导航菜单" class="headerlink" title="导航菜单"></a>导航菜单</h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br></pre></td><td class="code"><pre><span class="line"># 导航菜单</span><br><span class="line">menu:</span><br><span class="line">  Home: . </span><br><span class="line">  Archives: archives # 归档</span><br><span class="line">  Categories: categories # 分类</span><br><span class="line">  Tags: tags # 标签</span><br><span class="line">  Repository: repository # github repositories</span><br><span class="line">  Books: books     # 书单</span><br><span class="line">  Links: links # 友链</span><br><span class="line">  About: about # 关于</span><br><span class="line"></span><br><span class="line"># 导航菜单图标（font awesome）</span><br><span class="line">menu_icons:</span><br><span class="line">  enable: true # 是否启用菜单图标</span><br><span class="line">  home: icon-home-fill</span><br><span class="line">  archives: icon-archives-fill</span><br><span class="line">  categories: icon-folder</span><br><span class="line">  tags: icon-tags</span><br><span class="line">  repository: icon-project</span><br><span class="line">  books: icon-book-fill</span><br><span class="line">  links: icon-friendship</span><br><span class="line">  about: icon-cup-fill</span><br></pre></td></tr></table></figure><h3 id="设置个人信息"><a href="#设置个人信息" class="headerlink" title="设置个人信息"></a>设置个人信息</h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">头像在themes\pure\source\images 目录下替换图片即可，捐献的二维码同理。</span><br><span class="line"></span><br><span class="line">个人信息大部分都在 主题配置文件 中设置</span><br></pre></td></tr></table></figure><h3 id="搜索"><a href="#搜索" class="headerlink" title="搜索"></a>搜索</h3><p>主题内置三种站内搜索方式：insight、swiftype、baidu</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"># Search</span><br><span class="line">search:</span><br><span class="line">  insight: true # you need to install `hexo-generator-json-content` before using Insight Search</span><br><span class="line">  swiftype: # enter swiftype install key here</span><br><span class="line">  baidu: false # you need to disable other search engines to use Baidu search</span><br></pre></td></tr></table></figure><h3 id="分享"><a href="#分享" class="headerlink" title="分享"></a>分享</h3><p>支持<code>weibo,qq,qzone,wechat,tencent,douban,diandian,facebook,twitter,google,linkedin</code></p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"># Share</span><br><span class="line"># weibo,qq,qzone,wechat,tencent,douban,diandian,facebook,twitter,google,linkedin</span><br><span class="line">share:</span><br><span class="line">  enable: true  # 是否启用分享</span><br><span class="line">  sites: weibo,qq,wechat,facebook,twitter  # PC端显示的分享图标</span><br><span class="line">  mobile_sites: weibo,qq,qzone  # 移动端显示的分享图标</span><br></pre></td></tr></table></figure><h3 id="评论"><a href="#评论" class="headerlink" title="评论"></a>评论</h3><p>主题集成了<a href="https://disqus.com/">disqus</a>、<a href="http://www.uyan.cc/">友言</a>、<a href="https://livere.com/">来必力</a>、<a href="https://github.com/imsun/gitment">gitment</a>、<a href="https://github.com/gitalk/gitalk">gitalk</a>评论系统，选择其中一种即可</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line"># Comment</span><br><span class="line"># Gitment</span><br><span class="line"># Introduction: https://imsun.net/posts/gitment-introduction/</span><br><span class="line">comment:</span><br><span class="line">  type: livere # 启用哪种评论系统</span><br><span class="line">  disqus:  # enter disqus shortname here</span><br><span class="line">  youyan: </span><br><span class="line">    uid: *** # enter youyan uid </span><br><span class="line">  livere:</span><br><span class="line">    uid: *** # enter livere uid</span><br><span class="line">  gitment:</span><br><span class="line">    githubID: username</span><br><span class="line">    repo: username.github.io</span><br><span class="line">    ClientID: ***</span><br><span class="line">    ClientSecret: ***</span><br><span class="line">    lazy: false</span><br></pre></td></tr></table></figure><h3 id="文章浏览量统计"><a href="#文章浏览量统计" class="headerlink" title="文章浏览量统计"></a>文章浏览量统计</h3><p>主题内置了不蒜子和leancloud来统计文章浏览量，启用其中之一即可，注意leancloud需要到其官网申请APP ID 和APP Key。</p><p>比如，启用不蒜子来统计文章浏览量，在主题配置文件中把busuanzi设置为true即可：</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">pv:</span><br><span class="line">  busuanzi:</span><br><span class="line">    enable: true  # 不蒜子统计</span><br></pre></td></tr></table></figure><p>如果不需要第三方来统计浏览量，只需将相应设置改为false即可（设置为false后不会加载第三方JS脚本）</p><h3 id="项目"><a href="#项目" class="headerlink" title="项目"></a>项目</h3><p>复制<code>theme/pure/_source/</code> 目录下<code>repository</code>文件夹到<code>blog path/source/</code> 目录下</p><p>新版配置（支持 Github 和 Gitee）：</p><p><em>新版配置将会覆盖旧版的 github 配置！</em></p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"># Repository Info (This will override &#x27;github&#x27; option)</span><br><span class="line"># 项目仓库展示信息（将会覆盖 github 项）</span><br><span class="line">repository:</span><br><span class="line">  platform: github # 托管平台（github | gitee）</span><br><span class="line">  username: *** # 用户名</span><br></pre></td></tr></table></figure><p>旧版配置（仅支持 Github）：</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"># Github</span><br><span class="line">github: </span><br><span class="line">  username: ***  # github username</span><br></pre></td></tr></table></figure><h3 id="豆瓣书单"><a href="#豆瓣书单" class="headerlink" title="豆瓣书单"></a>豆瓣书单</h3><p>复制<code>theme/pure/_source/</code> 目录下<code>books</code>文件夹到<code>blog path/source/</code> 目录下</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"># douban 豆瓣书单</span><br><span class="line">douban:</span><br><span class="line">  user: *** # 豆瓣用户名</span><br><span class="line">  start: 0 # 从哪一条记录开始</span><br><span class="line">  count: 100 # 获取豆瓣书单数据条数</span><br></pre></td></tr></table></figure><h3 id="友情链接"><a href="#友情链接" class="headerlink" title="友情链接"></a>友情链接</h3><p>复制<code>theme/pure/_source/</code> 目录下<code>links</code>文件夹到<code>blog path/source/</code> 目录下</p><p>在 hexo 目录下的 source 文件夹内创建一个名为 _data（禁止改名）的文件夹。</p><p>然后在文件内创建一个名为 links.yml 的文件,在其中添加相关数据即可。</p><p>单个友情链接的格式为：</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">Name:</span><br><span class="line">    link: http://example.com</span><br><span class="line">    avatar: http://example.com/avatar.png</span><br><span class="line">    desc: &quot;这是一个描述&quot;</span><br></pre></td></tr></table></figure><p>添加多个友情链接，我们只需要根据上面的格式重复填写即可。</p><p>. 将 Name 改为友情链接的名字，例如 Cofess。</p><p>. <a href="http://example.com/">http://example.com</a> 为友情链接的地址。</p><p>. <a href="http://example.com/avatar.png">http://example.com/avatar.png</a> 为友情链接的头像。</p><p>. 这是一个描述 为友情链接描述。</p><h3 id="文章索引目录"><a href="#文章索引目录" class="headerlink" title="文章索引目录"></a>文章索引目录</h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">title: 文章标题</span><br><span class="line">categories:</span><br><span class="line">  - 文章分类</span><br><span class="line">tags:</span><br><span class="line">  - 文章标签</span><br><span class="line">toc: true # 是否启用内容索引</span><br></pre></td></tr></table></figure><h3 id="sidebar侧边栏"><a href="#sidebar侧边栏" class="headerlink" title="sidebar侧边栏"></a>sidebar侧边栏</h3><p>文章侧边栏默认为开启状态，如果某篇文章不想开启侧边栏，在文章开头配置加入“sidebar: none”即可：</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">title: 文章标题</span><br><span class="line">categories:</span><br><span class="line">  - 文章分类</span><br><span class="line">tags:</span><br><span class="line">  - 文章标签</span><br><span class="line">sidebar: none # 是否启用sidebar侧边栏，none：不启用</span><br></pre></td></tr></table></figure><h2 id="博客优化"><a href="#博客优化" class="headerlink" title="博客优化"></a>博客优化</h2><h3 id="hexo-neat"><a href="#hexo-neat" class="headerlink" title="hexo-neat"></a><a href="https://github.com/rozbo/hexo-neat">hexo-neat</a></h3><blockquote><p>auto Minify html、js、css and make it neat</p></blockquote><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install hexo-neat --save</span><br></pre></td></tr></table></figure><p>在博客配置文件<code>_config.yml</code>中添加</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line"># hexo-neat</span><br><span class="line">neat_enable: true</span><br><span class="line">neat_html:</span><br><span class="line">  enable: true</span><br><span class="line">  exclude:  </span><br><span class="line">neat_css:</span><br><span class="line">  enable: true</span><br><span class="line">  exclude:</span><br><span class="line">    - &#x27;*.min.css&#x27;</span><br><span class="line">neat_js:</span><br><span class="line">  enable: true</span><br><span class="line">  mangle: true</span><br><span class="line">  output:</span><br><span class="line">  compress:</span><br><span class="line">  exclude:</span><br><span class="line">    - &#x27;*.min.js&#x27; </span><br></pre></td></tr></table></figure><h3 id="hexo-baidu-url-submit"><a href="#hexo-baidu-url-submit" class="headerlink" title="hexo-baidu-url-submit"></a><a href="https://github.com/huiwang/hexo-baidu-url-submit">hexo-baidu-url-submit</a></h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install hexo-baidu-url-submit --save</span><br></pre></td></tr></table></figure><h3 id="hexo-translate-title"><a href="#hexo-translate-title" class="headerlink" title="hexo-translate-title"></a><a href="https://github.com/cometlj/hexo-translate-title">hexo-translate-title</a></h3><blockquote><p>使用Google翻译，百度翻译和有道翻译将Hexo中的汉字标题转成英文标题</p></blockquote><p>安装</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install hexo-translate-title --save</span><br></pre></td></tr></table></figure><p>在博客配置文件<code>_config.yml</code>中添加</p><figure class="highlight yml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">translate_title:</span></span><br><span class="line">  <span class="attr">translate_way:</span> <span class="string">google</span>    <span class="comment">#google | baidu | youdao</span></span><br><span class="line">  <span class="attr">youdao_api_key:</span> <span class="string">XXX</span></span><br><span class="line">  <span class="attr">youdao_keyfrom:</span> <span class="string">XXX</span></span><br><span class="line">  <span class="attr">is_need_proxy:</span> <span class="literal">true</span>     <span class="comment">#true | false</span></span><br><span class="line">  <span class="attr">proxy_url:</span> <span class="string">http://localhost:8123</span></span><br></pre></td></tr></table></figure><p><strong>注意</strong>：判断是否需要配置google本地代理，因为我在本地是开启时才能访问google翻译的，如果没有被墙，请将<code>_config.yml</code> 下的<code>is_need_proxy: true</code>改为false。如果设置为true,请设置本地代理地址</p><h2 id="数学公式"><a href="#数学公式" class="headerlink" title="数学公式"></a>数学公式</h2><blockquote><p>Hexo默认使用”hexo-renderer-marked”引擎渲染网页，该引擎会把一些特殊的markdown符号转换为相应的html标签</p></blockquote><h3 id="解决方案"><a href="#解决方案" class="headerlink" title="解决方案"></a>解决方案</h3><p>解决方案有很多，可以网上搜下，为了节省大家的时间，这里只提供亲身测试过的方法。</p><p>更换Hexo的markdown渲染引擎，<a href="https://github.com/CHENXCHEN/hexo-renderer-markdown-it-plus">hexo-renderer-markdown-it-plus</a>引擎替换默认的渲染引擎<a href="https://github.com/hexojs/hexo-renderer-marked">hexo-renderer-marked</a>即可。</p><h3 id="安装hexo-renderer-markdown-it-plus插件"><a href="#安装hexo-renderer-markdown-it-plus插件" class="headerlink" title="安装hexo-renderer-markdown-it-plus插件"></a>安装hexo-renderer-markdown-it-plus插件</h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">npm un hexo-renderer-marked --save</span><br><span class="line">npm i hexo-renderer-markdown-it-plus --save</span><br></pre></td></tr></table></figure><h3 id="配置"><a href="#配置" class="headerlink" title="配置"></a>配置</h3><p>安装插件后，如果未正常渲染LaTeX数学公式，在博客配置文件<code>_config.yml</code>中添加</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line">markdown_it_plus:</span><br><span class="line">  highlight: true</span><br><span class="line">  html: true</span><br><span class="line">  xhtmlOut: true</span><br><span class="line">  breaks: true</span><br><span class="line">  langPrefix:</span><br><span class="line">  linkify: true</span><br><span class="line">  typographer:</span><br><span class="line">  quotes: “”‘’</span><br><span class="line">  plugins:</span><br><span class="line">    - plugin:</span><br><span class="line">        name: markdown-it-katex</span><br><span class="line">        enable: true</span><br><span class="line">    - plugin:</span><br><span class="line">        name: markdown-it-mark</span><br><span class="line">        enable: false  </span><br></pre></td></tr></table></figure><h3 id="文章启用mathjax"><a href="#文章启用mathjax" class="headerlink" title="文章启用mathjax"></a>文章启用mathjax</h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">title: Hello World</span><br><span class="line">mathjax: true</span><br></pre></td></tr></table></figure>]]></content>
    
    
      
      
    <summary type="html">&lt;h1 id=&quot;pure&quot;&gt;&lt;a href=&quot;#pure&quot; class=&quot;headerlink&quot; title=&quot;pure&quot;&gt;&lt;/a&gt;pure&lt;/h1&gt;&lt;p&gt;A brand new default theme for [&lt;a href=&quot;https://hexo.io/&quot;&gt;Hexo</summary>
      
    
    
    
    <category term="hexo" scheme="https://engining.net/categories/hexo/"/>
    
    
    <category term="theme" scheme="https://engining.net/tags/theme/"/>
    
  </entry>
  
  <entry>
    <title>Hello Hexo</title>
    <link href="https://engining.net/2022/07/22/hello-world/"/>
    <id>https://engining.net/2022/07/22/hello-world/</id>
    <published>2022-07-22T07:54:53.000Z</published>
    <updated>2022-08-03T11:16:19.074Z</updated>
    
    <content type="html"><![CDATA[<p>Welcome to <a href="https://hexo.io/">Hexo</a>! This is your very first post. Check <a href="https://hexo.io/docs/">documentation</a> for more info. If you get any problems when using Hexo, you can find the answer in <a href="https://hexo.io/docs/troubleshooting.html">troubleshooting</a> or you can ask me on <a href="https://github.com/hexojs/hexo/issues">GitHub</a>.</p><h2 id="Quick-Start"><a href="#Quick-Start" class="headerlink" title="Quick Start"></a>Quick Start</h2><h3 id="Create-a-new-post"><a href="#Create-a-new-post" class="headerlink" title="Create a new post"></a>Create a new post</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo new <span class="string">&quot;My New Post&quot;</span></span><br></pre></td></tr></table></figure><p>More info: <a href="https://hexo.io/docs/writing.html">Writing</a></p><h3 id="Run-server"><a href="#Run-server" class="headerlink" title="Run server"></a>Run server</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo server</span><br></pre></td></tr></table></figure><p>More info: <a href="https://hexo.io/docs/server.html">Server</a></p><h3 id="Generate-static-files"><a href="#Generate-static-files" class="headerlink" title="Generate static files"></a>Generate static files</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo generate</span><br></pre></td></tr></table></figure><p>More info: <a href="https://hexo.io/docs/generating.html">Generating</a></p><h3 id="Deploy-to-remote-sites"><a href="#Deploy-to-remote-sites" class="headerlink" title="Deploy to remote sites"></a>Deploy to remote sites</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo deploy</span><br></pre></td></tr></table></figure><p>More info: <a href="https://hexo.io/docs/one-command-deployment.html">Deployment</a></p>]]></content>
    
    
      
      
    <summary type="html">&lt;p&gt;Welcome to &lt;a href=&quot;https://hexo.io/&quot;&gt;Hexo&lt;/a&gt;! This is your very first post. Check &lt;a href=&quot;https://hexo.io/docs/&quot;&gt;documentation&lt;/a&gt; for</summary>
      
    
    
    
    <category term="hexo" scheme="https://engining.net/categories/hexo/"/>
    
    
    <category term="quick start" scheme="https://engining.net/tags/quick-start/"/>
    
  </entry>
  
</feed>
