Skip to content

Commit

Permalink
Bump markdown-it-attrs from 4.2.0 to 4.3.0 (#120)
Browse files Browse the repository at this point in the history
Bumps [markdown-it-attrs](https://github.com/arve0/markdown-it-attrs) from 4.2.0 to 4.3.0.
- [Release notes](https://github.com/arve0/markdown-it-attrs/releases)
- [Commits](arve0/markdown-it-attrs@v4.2.0...v4.3.0)

---
updated-dependencies:
- dependency-name: markdown-it-attrs
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
wangjiezhe and dependabot[bot] committed Dec 3, 2024
1 parent 0b8365c commit 715c76e
Show file tree
Hide file tree
Showing 7 changed files with 193 additions and 193 deletions.
2 changes: 1 addition & 1 deletion categories/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<meta property="og:description" content="某不知名机构不知名数学老师">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2018-10-04T15:20:26.000Z">
<meta property="article:modified_time" content="2024-11-19T06:21:20.630Z">
<meta property="article:modified_time" content="2024-12-03T04:28:08.436Z">
<meta property="article:author" content="西风冷香">
<meta property="article:tag" content="Blog,Hexo,NexT,Math,博客,数学">
<meta name="twitter:card" content="summary">
Expand Down
2 changes: 1 addition & 1 deletion css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -1432,7 +1432,7 @@ pre code {
transition: all 0.2s ease-in-out;
}
.links-of-author a::before {
background: #83a4b3;
background: #87ffcb;
display: inline-block;
margin-right: 3px;
transform: translateY(-2px);
Expand Down
2 changes: 1 addition & 1 deletion links/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<meta property="og:image" content="https://wangjiezhe.github.io/images/travel-moe-pink.png">
<meta property="og:image" content="https://wangjiezhe.github.io/images/t9t.ico">
<meta property="article:published_time" content="2018-10-29T03:44:17.000Z">
<meta property="article:modified_time" content="2024-11-19T06:21:20.634Z">
<meta property="article:modified_time" content="2024-12-03T04:28:08.440Z">
<meta property="article:author" content="西风冷香">
<meta property="article:tag" content="Blog,Hexo,NexT,Math,博客,数学">
<meta name="twitter:card" content="summary">
Expand Down
116 changes: 58 additions & 58 deletions search.xml
Original file line number Diff line number Diff line change
Expand Up @@ -993,6 +993,64 @@ l0,-144c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
<blockquote>
<p>参见 <a href="/posts/2018-10-29-Hexo-NexT-3/">Hexo NexT 魔改系列之三 ── 评论篇</a></p>
</blockquote>
]]></content>
<categories>
<category>博客</category>
<category>主题</category>
</categories>
<tags>
<tag>Hexo</tag>
<tag>NexT</tag>
</tags>
</entry>
<entry>
<title>Hexo NexT 魔改系列之二 ── 搜索篇</title>
<url>//posts/2018-10-29-Hexo-NexT-2/</url>
<content><![CDATA[<p>Next主题本身集成了三种搜索插件:Swiftype,Algolia和本地搜索。</p>
<p>Swiftype只能试用14天,Aloglia好像也开始收费了(更新:社区版免费,但有限制),能有的就只有本地搜索了。</p>
<p>不过好在目前博客的文章还不算多,本地搜索还是可以承受的。</p>
<h2 id="1-启用本地搜索"><a class="header-anchor" href="#1-启用本地搜索"></a>1. 启用本地搜索</h2>
<p>启用本地搜索的方法很简单,先安装<code>hexo-generator-search</code>。</p>
<p>注意不是<code>hexo-generator-searchdb</code>,前者来自于<span class="exturl" data-url="aHR0cHM6Ly9naXRodWIuY29tL3d6cGFuL2hleG8tZ2VuZXJhdG9yLXNlYXJjaA==">wzpan/hexo-generator-search<i class="fa fa-external-link-alt"></i></span>,而后者来自于<span class="exturl" data-url="aHR0cHM6Ly9naXRodWIuY29tL3RoZW1lLW5leHQvaGV4by1nZW5lcmF0b3Itc2VhcmNoZGI=">theme-next/hexo-generator-searchdb<i class="fa fa-external-link-alt"></i></span>。后者已经一年多没有更新了,而前者还在更新,并且增加了仅搜索标题的功能。</p>
<figure class="highlight bash"><table><tr><td class="code"><pre><span class="line">yarn install hexo-generator-search</span><br></pre></td></tr></table></figure>
<p>然后在主题配置文件<sup class="footnote-ref"><a href="#fn1" id="fnref1">[1]</a></sup>里,启用本地搜索功能:</p>
<figure class="highlight yaml"><table><tr><td class="code"><pre><span class="line"><span class="comment"># Local search</span></span><br><span class="line"><span class="attr">local_search:</span></span><br><span class="line"> <span class="attr">enable:</span> <span class="literal">true</span></span><br></pre></td></tr></table></figure>
<p>然后重新生成页面:</p>
<figure class="highlight bash"><table><tr><td class="code"><pre><span class="line">hexo clean</span><br><span class="line">hexo server</span><br></pre></td></tr></table></figure>
<p>即可查看更改。</p>
<p>其实如果没有其它的需要的话,到这里就可以了,默认配置就已经足够用了。</p>
<p>也可以在站点配置文件<sup class="footnote-ref"><a href="#fn2" id="fnref2">[2]</a></sup>中添加配置:</p>
<figure class="highlight yaml"><table><tr><td class="code"><pre><span class="line"><span class="attr">search:</span></span><br><span class="line"> <span class="attr">path:</span> <span class="string">search.xml</span></span><br><span class="line"> <span class="attr">field:</span> <span class="string">post</span></span><br><span class="line"> <span class="attr">content:</span> <span class="literal">true</span></span><br></pre></td></tr></table></figure>
<ul>
<li><code>path</code>是生成的搜索文件的路径,默认是<code>search.xml</code>,也可以使用json格式,改为<code>search.json</code>。</li>
<li><code>field</code>是搜索的范围,默认是<code>post</code>,即只搜索发布的文章,也可以改为<code>page</code>(搜索页面,即 page 类型的页面,不含发布的文航)或者<code>all</code>(搜索全部)</li>
<li><code>content</code>是指是否搜索文章的内容,默认为<code>true</code>,如果改为<code>false</code>的话则只搜索标题、说明等头部内容,不搜索文章的正文。</li>
</ul>
<h2 id="2-解决能够正常搜索,但无法正常跳转的问题"><a class="header-anchor" href="#2-解决能够正常搜索,但无法正常跳转的问题"></a>2. 解决能够正常搜索,但无法正常跳转的问题</h2>
<p>这样配置完了之后,我发现搜索功能没有问题,但搜索出来的结果没有办法正确跳转。查看了一下生成的<code>search.xml</code>,发现生成的链接多了一个<code>/</code>,就像这样:</p>
<figure class="highlight xml"><table><tr><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">link</span> <span class="attr">href</span>=<span class="string">&quot;//posts/2018-10-24-prime-of-the-form-6k1/&quot;</span>/&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">url</span>&gt;</span>//posts/2018-10-24-prime-of-the-form-6k1/<span class="tag">&lt;/<span class="name">url</span>&gt;</span></span><br></pre></td></tr></table></figure>
<p>不过在各个教程中都没有找到相应的解决方法,最后在翻<span class="exturl" data-url="aHR0cHM6Ly9naXRodWIuY29tL2lpc3NuYW4vaGV4by10aGVtZS1uZXh0L2lzc3Vlcy8xODUy">issue<i class="fa fa-external-link-alt"></i></span>的时候发现了一个方法,就是在搜索的时候直接去掉一个<code>/</code>就好了。<br />
修改<code>localsearch.swig</code>的源代码:</p>
<figure class="highlight js"><table><tr><td class="code"><pre><span class="line"><span class="comment">// var articleUrl = decodeURIComponent(data.url);</span></span><br><span class="line"><span class="keyword">var</span> articleUrl = <span class="built_in">decodeURIComponent</span>(data.<span class="property">url</span>).<span class="title function_">substring</span>(<span class="number">1</span>);</span><br></pre></td></tr></table></figure>
<p>真的是简单粗暴啊。。。</p>
<h2 id="3-启用Algolia搜索(待更新)"><a class="header-anchor" href="#3-启用Algolia搜索(待更新)"></a>3. 启用Algolia搜索(待更新)</h2>
<p>最近发现,Agolia搜索的社区版还是免费的,不过暂时本地搜索已经够用了,就不再折腾搜索功能了,留待以后有时间再折腾吧。</p>
<blockquote>
<p>参见主题自带的文档:<span class="exturl" data-url="aHR0cHM6Ly9naXRodWIuY29tL3RoZW1lLW5leHQvaGV4by10aGVtZS1uZXh0L2Jsb2IvbWFzdGVyL2RvY3MvemgtQ04vQUxHT0xJQS1TRUFSQ0gubWQ=">Algolia 搜索<i class="fa fa-external-link-alt"></i></span>。</p>
</blockquote>
<p>参考:</p>
<ul>
<li><span class="exturl" data-url="aHR0cHM6Ly90aGVtZS1uZXh0Lmlpc3NuYW4uY29tL3RoaXJkLXBhcnR5LXNlcnZpY2VzLmh0bWwjc2VhcmNoLXN5c3RlbQ==">搜索服务 - NexT 使用文档<i class="fa fa-external-link-alt"></i></span></li>
</ul>
<hr class="footnotes-sep" />
<section class="footnotes">
<ol class="footnotes-list">
<li id="fn1" class="footnote-item"><p>指的是主题目录下(theme/next/)的<code>_config.yml</code>文件 <a href="#fnref1" class="footnote-backref">↩︎</a></p>
</li>
<li id="fn2" class="footnote-item"><p>指的是根目录下的<code>_config.yml</code>文件 <a href="#fnref2" class="footnote-backref">↩︎</a></p>
</li>
</ol>
</section>
]]></content>
<categories>
<category>博客</category>
Expand Down Expand Up @@ -1060,64 +1118,6 @@ DisqusJS<br />
<span class="exturl" data-url="aHR0cHM6Ly9wYW5qdW53ZW4uY29tL2Zyb20tZGlzcXVzLXRvLWxlYW5jbG91ZA==">使用LeanCloud做评论系统<i class="fa fa-external-link-alt"></i></span><br />
<span class="exturl" data-url="aHR0cHM6Ly9sZWFmZXJ4Lm9ubGluZS8yMDE4LzAyLzExL2xjLXNlY3VyaXR5">Leancloud访客统计插件重大安全漏洞修复指南<i class="fa fa-external-link-alt"></i></span></p>
</blockquote>
]]></content>
<categories>
<category>博客</category>
<category>主题</category>
</categories>
<tags>
<tag>Hexo</tag>
<tag>NexT</tag>
</tags>
</entry>
<entry>
<title>Hexo NexT 魔改系列之二 ── 搜索篇</title>
<url>//posts/2018-10-29-Hexo-NexT-2/</url>
<content><![CDATA[<p>Next主题本身集成了三种搜索插件:Swiftype,Algolia和本地搜索。</p>
<p>Swiftype只能试用14天,Aloglia好像也开始收费了(更新:社区版免费,但有限制),能有的就只有本地搜索了。</p>
<p>不过好在目前博客的文章还不算多,本地搜索还是可以承受的。</p>
<h2 id="1-启用本地搜索"><a class="header-anchor" href="#1-启用本地搜索"></a>1. 启用本地搜索</h2>
<p>启用本地搜索的方法很简单,先安装<code>hexo-generator-search</code>。</p>
<p>注意不是<code>hexo-generator-searchdb</code>,前者来自于<span class="exturl" data-url="aHR0cHM6Ly9naXRodWIuY29tL3d6cGFuL2hleG8tZ2VuZXJhdG9yLXNlYXJjaA==">wzpan/hexo-generator-search<i class="fa fa-external-link-alt"></i></span>,而后者来自于<span class="exturl" data-url="aHR0cHM6Ly9naXRodWIuY29tL3RoZW1lLW5leHQvaGV4by1nZW5lcmF0b3Itc2VhcmNoZGI=">theme-next/hexo-generator-searchdb<i class="fa fa-external-link-alt"></i></span>。后者已经一年多没有更新了,而前者还在更新,并且增加了仅搜索标题的功能。</p>
<figure class="highlight bash"><table><tr><td class="code"><pre><span class="line">yarn install hexo-generator-search</span><br></pre></td></tr></table></figure>
<p>然后在主题配置文件<sup class="footnote-ref"><a href="#fn1" id="fnref1">[1]</a></sup>里,启用本地搜索功能:</p>
<figure class="highlight yaml"><table><tr><td class="code"><pre><span class="line"><span class="comment"># Local search</span></span><br><span class="line"><span class="attr">local_search:</span></span><br><span class="line"> <span class="attr">enable:</span> <span class="literal">true</span></span><br></pre></td></tr></table></figure>
<p>然后重新生成页面:</p>
<figure class="highlight bash"><table><tr><td class="code"><pre><span class="line">hexo clean</span><br><span class="line">hexo server</span><br></pre></td></tr></table></figure>
<p>即可查看更改。</p>
<p>其实如果没有其它的需要的话,到这里就可以了,默认配置就已经足够用了。</p>
<p>也可以在站点配置文件<sup class="footnote-ref"><a href="#fn2" id="fnref2">[2]</a></sup>中添加配置:</p>
<figure class="highlight yaml"><table><tr><td class="code"><pre><span class="line"><span class="attr">search:</span></span><br><span class="line"> <span class="attr">path:</span> <span class="string">search.xml</span></span><br><span class="line"> <span class="attr">field:</span> <span class="string">post</span></span><br><span class="line"> <span class="attr">content:</span> <span class="literal">true</span></span><br></pre></td></tr></table></figure>
<ul>
<li><code>path</code>是生成的搜索文件的路径,默认是<code>search.xml</code>,也可以使用json格式,改为<code>search.json</code>。</li>
<li><code>field</code>是搜索的范围,默认是<code>post</code>,即只搜索发布的文章,也可以改为<code>page</code>(搜索页面,即 page 类型的页面,不含发布的文航)或者<code>all</code>(搜索全部)</li>
<li><code>content</code>是指是否搜索文章的内容,默认为<code>true</code>,如果改为<code>false</code>的话则只搜索标题、说明等头部内容,不搜索文章的正文。</li>
</ul>
<h2 id="2-解决能够正常搜索,但无法正常跳转的问题"><a class="header-anchor" href="#2-解决能够正常搜索,但无法正常跳转的问题"></a>2. 解决能够正常搜索,但无法正常跳转的问题</h2>
<p>这样配置完了之后,我发现搜索功能没有问题,但搜索出来的结果没有办法正确跳转。查看了一下生成的<code>search.xml</code>,发现生成的链接多了一个<code>/</code>,就像这样:</p>
<figure class="highlight xml"><table><tr><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">link</span> <span class="attr">href</span>=<span class="string">&quot;//posts/2018-10-24-prime-of-the-form-6k1/&quot;</span>/&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">url</span>&gt;</span>//posts/2018-10-24-prime-of-the-form-6k1/<span class="tag">&lt;/<span class="name">url</span>&gt;</span></span><br></pre></td></tr></table></figure>
<p>不过在各个教程中都没有找到相应的解决方法,最后在翻<span class="exturl" data-url="aHR0cHM6Ly9naXRodWIuY29tL2lpc3NuYW4vaGV4by10aGVtZS1uZXh0L2lzc3Vlcy8xODUy">issue<i class="fa fa-external-link-alt"></i></span>的时候发现了一个方法,就是在搜索的时候直接去掉一个<code>/</code>就好了。<br />
修改<code>localsearch.swig</code>的源代码:</p>
<figure class="highlight js"><table><tr><td class="code"><pre><span class="line"><span class="comment">// var articleUrl = decodeURIComponent(data.url);</span></span><br><span class="line"><span class="keyword">var</span> articleUrl = <span class="built_in">decodeURIComponent</span>(data.<span class="property">url</span>).<span class="title function_">substring</span>(<span class="number">1</span>);</span><br></pre></td></tr></table></figure>
<p>真的是简单粗暴啊。。。</p>
<h2 id="3-启用Algolia搜索(待更新)"><a class="header-anchor" href="#3-启用Algolia搜索(待更新)"></a>3. 启用Algolia搜索(待更新)</h2>
<p>最近发现,Agolia搜索的社区版还是免费的,不过暂时本地搜索已经够用了,就不再折腾搜索功能了,留待以后有时间再折腾吧。</p>
<blockquote>
<p>参见主题自带的文档:<span class="exturl" data-url="aHR0cHM6Ly9naXRodWIuY29tL3RoZW1lLW5leHQvaGV4by10aGVtZS1uZXh0L2Jsb2IvbWFzdGVyL2RvY3MvemgtQ04vQUxHT0xJQS1TRUFSQ0gubWQ=">Algolia 搜索<i class="fa fa-external-link-alt"></i></span>。</p>
</blockquote>
<p>参考:</p>
<ul>
<li><span class="exturl" data-url="aHR0cHM6Ly90aGVtZS1uZXh0Lmlpc3NuYW4uY29tL3RoaXJkLXBhcnR5LXNlcnZpY2VzLmh0bWwjc2VhcmNoLXN5c3RlbQ==">搜索服务 - NexT 使用文档<i class="fa fa-external-link-alt"></i></span></li>
</ul>
<hr class="footnotes-sep" />
<section class="footnotes">
<ol class="footnotes-list">
<li id="fn1" class="footnote-item"><p>指的是主题目录下(theme/next/)的<code>_config.yml</code>文件 <a href="#fnref1" class="footnote-backref">↩︎</a></p>
</li>
<li id="fn2" class="footnote-item"><p>指的是根目录下的<code>_config.yml</code>文件 <a href="#fnref2" class="footnote-backref">↩︎</a></p>
</li>
</ol>
</section>
]]></content>
<categories>
<category>博客</category>
Expand Down
Loading

0 comments on commit 715c76e

Please sign in to comment.