doc: update document

This commit is contained in:
mozzie 2023-10-20 13:35:01 +08:00
parent 786d033d42
commit d3dc123efe
9 changed files with 189 additions and 102 deletions

File diff suppressed because one or more lines are too long

View File

@ -257,7 +257,7 @@
<p><a target="_blank" rel="noopener" href="https://baidu.com/">https://baidu.com</a></p>
<p><a target="_blank" rel="noopener" href="http://www.this-anchor-link.com/">锚点链接</a> </p>
<p><a href="mailto:test.test@gmail.com">mailto:test.test@gmail.com</a></p>
<p>GFM a-tail link <a target="_blank" rel="noopener" href="https://my.oschina.net/u/3691274">@pandao</a> 邮箱地址自动链接 <a href="mailto:&#116;&#x65;&#x73;&#x74;&#x2e;&#116;&#x65;&#115;&#116;&#64;&#103;&#109;&#97;&#105;&#108;&#46;&#x63;&#111;&#x6d;">&#116;&#x65;&#x73;&#x74;&#x2e;&#116;&#x65;&#115;&#116;&#64;&#103;&#109;&#97;&#105;&#108;&#46;&#x63;&#111;&#x6d;</a> <a href="mailto:&#x77;&#119;&#119;&#64;&#118;&#105;&#x70;&#x2e;&#x71;&#x71;&#46;&#x63;&#111;&#x6d;">&#x77;&#119;&#119;&#64;&#118;&#105;&#x70;&#x2e;&#x71;&#x71;&#46;&#x63;&#111;&#x6d;</a></p>
<p>GFM a-tail link <a target="_blank" rel="noopener" href="https://my.oschina.net/u/3691274">@pandao</a> 邮箱地址自动链接 <a href="mailto:&#x74;&#101;&#x73;&#116;&#x2e;&#116;&#x65;&#115;&#116;&#x40;&#x67;&#109;&#97;&#x69;&#108;&#46;&#x63;&#111;&#109;">&#x74;&#101;&#x73;&#116;&#x2e;&#116;&#x65;&#115;&#116;&#x40;&#x67;&#109;&#97;&#x69;&#108;&#46;&#x63;&#111;&#109;</a> <a href="mailto:&#x77;&#x77;&#119;&#x40;&#118;&#105;&#x70;&#46;&#x71;&#x71;&#46;&#x63;&#x6f;&#109;">&#x77;&#x77;&#119;&#x40;&#118;&#105;&#x70;&#46;&#x71;&#x71;&#46;&#x63;&#x6f;&#109;</a></p>
<blockquote>
<p>@pandao</p>
</blockquote>

View File

@ -220,7 +220,17 @@
<!-- 文章tags -->
<!-- 渲染文章内容 -->
<article><h1 id="hexo配置"><a href="#hexo配置" class="headerlink" title="hexo配置"></a>hexo配置</h1><p><code>hexo</code><code>_config.yml</code> 中调整</p>
<article><h1 id="Hexo-安装主题"><a href="#Hexo-安装主题" class="headerlink" title="Hexo 安装主题"></a>Hexo 安装主题</h1><p><code>Hexo</code> 主题的安装方式非常简单,只需将主题 <code>Hexo-theme-linear</code> 复制目录的 <code>themes</code> 目录下,然后在 <code>Hexo</code><code>_config.yml</code> 中修改下主题配置即可</p>
<pre class="line-numbers language-yaml" data-language="yaml"><code class="language-yaml"><span class="token comment"># 找到 theme 配置项</span>
<span class="token key atrule">theme</span><span class="token punctuation">:</span> Hexo<span class="token punctuation">-</span>theme<span class="token punctuation">-</span>linear<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span></span></code></pre>
<h2 id="获取-Linear"><a href="#获取-Linear" class="headerlink" title="获取 Linear"></a>获取 Linear</h2><ul>
<li>进入 <a target="_blank" rel="noopener" href="https://github.com/17px/hexo-theme-linear/tree/main">Linear 代码仓库</a>,了解最新的主题开发进度</li>
<li><a target="_blank" rel="noopener" href="https://github.com/17px/hexo-theme-linear/releases">发布页面</a> 下载 <code>hexo-theme-linear.zip</code></li>
<li>解压至站点的 <code>themes</code> 目录下</li>
<li>在 Hexo 的 <code>_config.yml</code> 中启用</li>
</ul>
<h1 id="hexo配置"><a href="#hexo配置" class="headerlink" title="hexo配置"></a>hexo配置</h1><p><code>Hexo</code><code>_config.yml</code> 中调整</p>
<h2 id="基础配置"><a href="#基础配置" class="headerlink" title="基础配置"></a>基础配置</h2><pre class="line-numbers language-yaml" data-language="yaml"><code class="language-yaml"><span class="token comment"># 网页标题</span>
<span class="token key atrule">title</span><span class="token punctuation">:</span> 17px blog
<span class="token comment"># 侧边栏顶部显示</span>
@ -237,14 +247,15 @@
<h2 id="国际化切换"><a href="#国际化切换" class="headerlink" title="国际化切换"></a>国际化切换</h2><pre class="line-numbers language-yaml" data-language="yaml"><code class="language-yaml"><span class="token key atrule">language</span><span class="token punctuation">:</span> en<span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre>
<h2 id="文章语法高亮"><a href="#文章语法高亮" class="headerlink" title="文章语法高亮"></a>文章语法高亮</h2><pre class="line-numbers language-yaml" data-language="yaml"><code class="language-yaml"><span class="token comment"># 关闭hexo默认的highlight.js语法高亮</span>
<span class="token key atrule">highlight</span><span class="token punctuation">:</span>
<h2 id="文章语法高亮"><a href="#文章语法高亮" class="headerlink" title="文章语法高亮"></a>文章语法高亮</h2><p>关闭hexo默认的highlight.js语法高亮</p>
<pre class="line-numbers language-yaml" data-language="yaml"><code class="language-yaml"><span class="token key atrule">highlight</span><span class="token punctuation">:</span>
<span class="token key atrule">enable</span><span class="token punctuation">:</span> <span class="token boolean important">false</span>
<span class="token key atrule">line_number</span><span class="token punctuation">:</span> <span class="token boolean important">true</span>
<span class="token key atrule">auto_detect</span><span class="token punctuation">:</span> <span class="token boolean important">false</span>
<span class="token key atrule">tab_replace</span><span class="token punctuation">:</span> <span class="token string">""</span>
<span class="token key atrule">wrap</span><span class="token punctuation">:</span> <span class="token boolean important">true</span>
<span class="token key atrule">hljs</span><span class="token punctuation">:</span> <span class="token boolean important">false</span>
<span class="token key atrule">prismjs</span><span class="token punctuation">:</span>
<span class="token key atrule">enable</span><span class="token punctuation">:</span> <span class="token boolean important">true</span>
<span class="token key atrule">preprocess</span><span class="token punctuation">:</span> <span class="token boolean important">true</span>
@ -252,43 +263,13 @@
<span class="token key atrule">line_threshold</span><span class="token punctuation">:</span> <span class="token number">0</span>
<span class="token key atrule">tab_replace</span><span class="token punctuation">:</span> <span class="token string">""</span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>
<h2 id="algolia搜索"><a href="#algolia搜索" class="headerlink" title="algolia搜索"></a>algolia搜索</h2><pre class="line-numbers language-yaml" data-language="yaml"><code class="language-yaml"><span class="token comment"># search service</span>
<span class="token key atrule">algolia</span><span class="token punctuation">:</span>
<span class="token comment"># 替换</span>
<span class="token key atrule">appId</span><span class="token punctuation">:</span> appId
<span class="token comment"># 替换</span>
<span class="token key atrule">apiKey</span><span class="token punctuation">:</span> apiKey
<span class="token comment"># 请勿泄露,用于上报,替换</span>
<span class="token key atrule">adminApiKey</span><span class="token punctuation">:</span> adminApiKey
<span class="token comment"># 替换</span>
<span class="token key atrule">SearchOnlyAPIKey</span><span class="token punctuation">:</span> SearchOnlyAPIKey
<span class="token key atrule">chunkSize</span><span class="token punctuation">:</span> <span class="token number">5000</span>
<span class="token comment"># 替换</span>
<span class="token key atrule">indexName</span><span class="token punctuation">:</span> indexName
<span class="token key atrule">fields</span><span class="token punctuation">:</span>
<span class="token punctuation">-</span> content<span class="token punctuation">:</span>strip
<span class="token punctuation">-</span> categories
<span class="token punctuation">-</span> date
<span class="token punctuation">-</span> permalink
<span class="token punctuation">-</span> slug
<span class="token punctuation">-</span> tags
<span class="token punctuation">-</span> title<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>
<h1 id="Linear主题配置"><a href="#Linear主题配置" class="headerlink" title="Linear主题配置"></a>Linear主题配置</h1><p>下面的配置基于 <code>hexo-theme-linear</code> 下的 <code>_config.yml</code> </p>
<h1 id="Linear主题配置"><a href="#Linear主题配置" class="headerlink" title="Linear主题配置"></a>Linear主题配置</h1><p>下面的配置基于 <code>Hexo-theme-linear</code> 下的 <code>_config.yml</code> </p>
<h2 id="文章分类图标"><a href="#文章分类图标" class="headerlink" title="文章分类图标"></a>文章分类图标</h2><p>按照顺序,依次设置 <code>svg</code> 图标,可以在 <a target="_blank" rel="noopener" href="https://www.xicons.org/">xicon</a> 方面的获取丰富的图标</p>
<pre class="line-numbers language-yaml" data-language="yaml"><code class="language-yaml"><span class="token key atrule">postCategoryIcons</span><span class="token punctuation">:</span>
<span class="token punctuation">-</span> &lt;svg<span class="token punctuation">></span><span class="token punctuation">...</span>&lt;/svg<span class="token punctuation">></span>
<span class="token punctuation">-</span> &lt;svg<span class="token punctuation">></span><span class="token punctuation">...</span>&lt;/svg<span class="token punctuation">></span>
<span class="token punctuation">-</span> &lt;svg<span class="token punctuation">></span><span class="token punctuation">...</span>&lt;/svg<span class="token punctuation">></span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span></span></code></pre>
<h2 id="天气卡片"><a href="#天气卡片" class="headerlink" title="天气卡片"></a>天气卡片</h2><p><a target="_blank" rel="noopener" href="https://id.qweather.com/#/register">和风天气API - 注册</a></p>
<pre class="line-numbers language-yaml" data-language="yaml"><code class="language-yaml"><span class="token key atrule">weather</span><span class="token punctuation">:</span>
<span class="token key atrule">enable</span><span class="token punctuation">:</span> <span class="token boolean important">true</span>
<span class="token comment"># 替换</span>
<span class="token key atrule">cityCode</span><span class="token punctuation">:</span> cityCode
<span class="token key atrule">appKey</span><span class="token punctuation">:</span> appKey<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span></span></code></pre>
<p>配置中的 <code>cityCode</code> 可以在 <a target="_blank" rel="noopener" href="https://github.com/qwd/LocationList">官方的地区列表仓库</a> 中的 <code>China-City-List-latest.csv</code> 找到你所在城市的 <code>cityCode</code></p>
<h2 id="网站图标-favicon"><a href="#网站图标-favicon" class="headerlink" title="网站图标 favicon"></a>网站图标 favicon</h2><ul>
<li>支持 <code>svg</code></li>
<li>支持 <code>图片url</code>,如:<code>/img/favicon.png</code></li>
@ -338,7 +319,70 @@ graph TD;
<span class="token key atrule">avatar</span><span class="token punctuation">:</span> monsterid
<span class="token key atrule">cdn</span><span class="token punctuation">:</span> //unpkg.com/valine@latest/dist/Valine.min.js
<span class="token comment"># 替换</span>
<span class="token key atrule">serverURLs</span><span class="token punctuation">:</span> //xxxxxxxx.api.lncldglobal.com<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre></article>
<span class="token key atrule">serverURLs</span><span class="token punctuation">:</span> //xxxxxxxx.api.lncldglobal.com<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>
<h1 id="algolia搜索"><a href="#algolia搜索" class="headerlink" title="algolia搜索"></a>algolia搜索</h1><p>博客自带的本地搜索,基于前端开发,存在或多或少的问题,建议换成 <code>algolia</code>,免费账户 总共有 <code>10,000</code> 条记录,每月有 <code>100,000</code> 的操作数</p>
<h2 id="注册-amp-获取-Key"><a href="#注册-amp-获取-Key" class="headerlink" title="注册 &amp; 获取 Key"></a>注册 &amp; 获取 Key</h2><ol>
<li><p>创建一个新的 <code>Index</code>,例如 <code>hex-blog</code></p>
</li>
<li><p>复制并保存:</p>
</li>
</ol>
<ul>
<li>Application ID</li>
<li>Search-Only API Key</li>
<li>Admin API Key</li>
<li>Usage API Key</li>
</ul>
<p><a href="/img/algolia-api-keys.png">API Keys</a></p>
<ol start="3">
<li>替换配置</li>
</ol>
<p><code>Hexo</code><code>_config.yml</code> 中加入</p>
<pre class="line-numbers language-yaml" data-language="yaml"><code class="language-yaml"><span class="token key atrule">algolia</span><span class="token punctuation">:</span>
<span class="token comment"># 替换</span>
<span class="token key atrule">appId</span><span class="token punctuation">:</span> Application ID
<span class="token comment"># 替换</span>
<span class="token key atrule">apiKey</span><span class="token punctuation">:</span> Usage API Key
<span class="token comment"># 请勿泄露,用于上报,替换</span>
<span class="token key atrule">adminApiKey</span><span class="token punctuation">:</span> Admin API Key
<span class="token comment"># 替换</span>
<span class="token key atrule">SearchOnlyAPIKey</span><span class="token punctuation">:</span> Search<span class="token punctuation">-</span>Only API Key
<span class="token key atrule">chunkSize</span><span class="token punctuation">:</span> <span class="token number">5000</span>
<span class="token comment"># 替换</span>
<span class="token key atrule">indexName</span><span class="token punctuation">:</span> hex<span class="token punctuation">-</span>blog
<span class="token key atrule">fields</span><span class="token punctuation">:</span>
<span class="token punctuation">-</span> content<span class="token punctuation">:</span>strip
<span class="token punctuation">-</span> categories
<span class="token punctuation">-</span> date
<span class="token punctuation">-</span> permalink
<span class="token punctuation">-</span> slug
<span class="token punctuation">-</span> tags
<span class="token punctuation">-</span> title<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>
<h2 id="安装-hexo-algoliasearch"><a href="#安装-hexo-algoliasearch" class="headerlink" title="安装 hexo-algoliasearch"></a>安装 hexo-algoliasearch</h2><p>这是 Hexo 博客帖子索引插件,自动化提交索引到 Algolia</p>
<blockquote>
<p>如出遇到问题,可阅读 <a target="_blank" rel="noopener" href="https://www.npmjs.com/package/hexo-algoliasearch">hexo-algoliasearch 仓库</a> 最新说明</p>
</blockquote>
<p>安装命令:</p>
<pre class="line-numbers language-bash" data-language="bash"><code class="language-bash"><span class="token function">npm</span> <span class="token function">install</span> hexo-algoliasearch <span class="token parameter variable">--save</span><span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre>
<h2 id="使用-algolia"><a href="#使用-algolia" class="headerlink" title="使用 algolia"></a>使用 algolia</h2><p>在每次博客发布之前,进行索引上传的操作,命令通常如下</p>
<pre class="line-numbers language-bash" data-language="bash"><code class="language-bash">hexo clean
hexo generate
hexo algolia<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span></span></code></pre>
<h1 id="🇨🇳-和风天气-Widget"><a href="#🇨🇳-和风天气-Widget" class="headerlink" title="🇨🇳 和风天气 Widget"></a>🇨🇳 和风天气 Widget</h1><p>Linear 主要针对国内用户,在首页集成了和风天气的卡片,通过 <a target="_blank" rel="noopener" href="https://dev.qweather.com/docs/start/">和风天气开发服务</a> 注册</p>
<p>注册完成后,在配置中填入你的 <code>appKey</code><code>cityCode(城市代码)</code></p>
<pre class="line-numbers language-yaml" data-language="yaml"><code class="language-yaml"><span class="token key atrule">weather</span><span class="token punctuation">:</span>
<span class="token key atrule">enable</span><span class="token punctuation">:</span> <span class="token boolean important">true</span>
<span class="token comment"># 替换</span>
<span class="token key atrule">cityCode</span><span class="token punctuation">:</span> cityCode
<span class="token key atrule">appKey</span><span class="token punctuation">:</span> appKey<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span></span></code></pre>
<p>其中 <code>cityCode</code> 可以在 <a target="_blank" rel="noopener" href="https://github.com/qwd/LocationList">官方的地区列表仓库</a> 中的 <code>China-City-List-latest.csv</code> 找到你所在城市的 <code>cityCode</code></p>
</article>
<link rel="stylesheet" href="/css/ccbcde32.css">
@ -387,7 +431,7 @@ graph TD;
<span>Catalog</span>
</p>
<!-- 文章toc -->
<ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#hexo%E9%85%8D%E7%BD%AE"><span class="toc-number">1.</span> <span class="toc-text">hexo配置</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%9F%BA%E7%A1%80%E9%85%8D%E7%BD%AE"><span class="toc-number">1.1.</span> <span class="toc-text">基础配置</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%9B%BD%E9%99%85%E5%8C%96%E5%88%87%E6%8D%A2"><span class="toc-number">1.2.</span> <span class="toc-text">国际化切换</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%96%87%E7%AB%A0%E8%AF%AD%E6%B3%95%E9%AB%98%E4%BA%AE"><span class="toc-number">1.3.</span> <span class="toc-text">文章语法高亮</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#algolia%E6%90%9C%E7%B4%A2"><span class="toc-number">1.4.</span> <span class="toc-text">algolia搜索</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#Linear%E4%B8%BB%E9%A2%98%E9%85%8D%E7%BD%AE"><span class="toc-number">2.</span> <span class="toc-text">Linear主题配置</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%96%87%E7%AB%A0%E5%88%86%E7%B1%BB%E5%9B%BE%E6%A0%87"><span class="toc-number">2.1.</span> <span class="toc-text">文章分类图标</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%A4%A9%E6%B0%94%E5%8D%A1%E7%89%87"><span class="toc-number">2.2.</span> <span class="toc-text">天气卡片</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E7%BD%91%E7%AB%99%E5%9B%BE%E6%A0%87-favicon"><span class="toc-number">2.3.</span> <span class="toc-text">网站图标 favicon</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#ICP%E5%A4%87%E6%A1%88%E5%8F%B7"><span class="toc-number">2.4.</span> <span class="toc-text">ICP备案号</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E9%A6%96%E9%A1%B5%E5%BA%95%E9%83%A8%E6%96%87%E5%AD%97"><span class="toc-number">2.5.</span> <span class="toc-text">首页底部文字</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%96%87%E7%AB%A0%E7%89%88%E6%9D%83%E7%94%B3%E6%98%8E"><span class="toc-number">2.6.</span> <span class="toc-text">文章版权申明</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#katex-%E6%95%B0%E5%AD%A6%E5%85%AC%E5%BC%8F"><span class="toc-number">2.7.</span> <span class="toc-text">katex 数学公式</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#mermaid-%E6%B5%81%E7%A8%8B%E5%9B%BE"><span class="toc-number">2.8.</span> <span class="toc-text">mermaid 流程图</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#valine-%E6%96%87%E7%AB%A0%E8%AF%84%E8%AE%BA"><span class="toc-number">2.9.</span> <span class="toc-text">valine 文章评论</span></a></li></ol></li></ol>
<ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#Hexo-%E5%AE%89%E8%A3%85%E4%B8%BB%E9%A2%98"><span class="toc-number">1.</span> <span class="toc-text">Hexo 安装主题</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E8%8E%B7%E5%8F%96-Linear"><span class="toc-number">1.1.</span> <span class="toc-text">获取 Linear</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#hexo%E9%85%8D%E7%BD%AE"><span class="toc-number">2.</span> <span class="toc-text">hexo配置</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%9F%BA%E7%A1%80%E9%85%8D%E7%BD%AE"><span class="toc-number">2.1.</span> <span class="toc-text">基础配置</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%9B%BD%E9%99%85%E5%8C%96%E5%88%87%E6%8D%A2"><span class="toc-number">2.2.</span> <span class="toc-text">国际化切换</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%96%87%E7%AB%A0%E8%AF%AD%E6%B3%95%E9%AB%98%E4%BA%AE"><span class="toc-number">2.3.</span> <span class="toc-text">文章语法高亮</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#Linear%E4%B8%BB%E9%A2%98%E9%85%8D%E7%BD%AE"><span class="toc-number">3.</span> <span class="toc-text">Linear主题配置</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%96%87%E7%AB%A0%E5%88%86%E7%B1%BB%E5%9B%BE%E6%A0%87"><span class="toc-number">3.1.</span> <span class="toc-text">文章分类图标</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E7%BD%91%E7%AB%99%E5%9B%BE%E6%A0%87-favicon"><span class="toc-number">3.2.</span> <span class="toc-text">网站图标 favicon</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#ICP%E5%A4%87%E6%A1%88%E5%8F%B7"><span class="toc-number">3.3.</span> <span class="toc-text">ICP备案号</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E9%A6%96%E9%A1%B5%E5%BA%95%E9%83%A8%E6%96%87%E5%AD%97"><span class="toc-number">3.4.</span> <span class="toc-text">首页底部文字</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%96%87%E7%AB%A0%E7%89%88%E6%9D%83%E7%94%B3%E6%98%8E"><span class="toc-number">3.5.</span> <span class="toc-text">文章版权申明</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#katex-%E6%95%B0%E5%AD%A6%E5%85%AC%E5%BC%8F"><span class="toc-number">3.6.</span> <span class="toc-text">katex 数学公式</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#mermaid-%E6%B5%81%E7%A8%8B%E5%9B%BE"><span class="toc-number">3.7.</span> <span class="toc-text">mermaid 流程图</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#valine-%E6%96%87%E7%AB%A0%E8%AF%84%E8%AE%BA"><span class="toc-number">3.8.</span> <span class="toc-text">valine 文章评论</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#algolia%E6%90%9C%E7%B4%A2"><span class="toc-number">4.</span> <span class="toc-text">algolia搜索</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%B3%A8%E5%86%8C-amp-%E8%8E%B7%E5%8F%96-Key"><span class="toc-number">4.1.</span> <span class="toc-text">注册 &amp; 获取 Key</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%AE%89%E8%A3%85-hexo-algoliasearch"><span class="toc-number">4.2.</span> <span class="toc-text">安装 hexo-algoliasearch</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%BD%BF%E7%94%A8-algolia"><span class="toc-number">4.3.</span> <span class="toc-text">使用 algolia</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%F0%9F%87%A8%F0%9F%87%B3-%E5%92%8C%E9%A3%8E%E5%A4%A9%E6%B0%94-Widget"><span class="toc-number">5.</span> <span class="toc-text">🇨🇳 和风天气 Widget</span></a></li></ol>
</div>
</div>
</div>

View File

@ -254,12 +254,7 @@ Smart Test…
<span>Linear 入门</span>
</div>
<p>hexo配置在 hexo 的 _config.yml 中调整
基础配置# 网页标题
title: 17px blog
# 侧边栏顶部显示
subtitle: &#34;Mozzie&#34;
# 用于SEO的html...</p>
<p>Hexo 安装主题Hexo 主题的安装方式非常简单,只需将主题 Hexo-theme-linear 复制目录的 themes 目录下,然后在 Hexo 的 _config.yml 中修改下主题配置即可...</p>
</div>
</a>
</li>

View File

@ -254,12 +254,7 @@ Smart Test…
<span>Linear 入门</span>
</div>
<p>hexo配置在 hexo 的 _config.yml 中调整
基础配置# 网页标题
title: 17px blog
# 侧边栏顶部显示
subtitle: &#34;Mozzie&#34;
# 用于SEO的html...</p>
<p>Hexo 安装主题Hexo 主题的安装方式非常简单,只需将主题 Hexo-theme-linear 复制目录的 themes 目录下,然后在 Hexo 的 _config.yml 中修改下主题配置即可...</p>
</div>
</a>
</li>

View File

@ -254,12 +254,7 @@ Smart Test…
<span>Linear 入门</span>
</div>
<p>hexo配置在 hexo 的 _config.yml 中调整
基础配置# 网页标题
title: 17px blog
# 侧边栏顶部显示
subtitle: &#34;Mozzie&#34;
# 用于SEO的html...</p>
<p>Hexo 安装主题Hexo 主题的安装方式非常简单,只需将主题 Hexo-theme-linear 复制目录的 themes 目录下,然后在 Hexo 的 _config.yml 中修改下主题配置即可...</p>
</div>
</a>
</li>

Binary file not shown.

After

Width:  |  Height:  |  Size: 277 KiB

View File

@ -6,9 +6,25 @@ categories:
status: doing
---
# Hexo 安装主题
`Hexo` 主题的安装方式非常简单,只需将主题 `Hexo-theme-linear` 复制目录的 `themes` 目录下,然后在 `Hexo``_config.yml` 中修改下主题配置即可
```yml
# 找到 theme 配置项
theme: Hexo-theme-linear
```
## 获取 Linear
- 进入 [Linear 代码仓库](https://github.com/17px/hexo-theme-linear/tree/main),了解最新的主题开发进度
- 在 [发布页面](https://github.com/17px/hexo-theme-linear/releases) 下载 `hexo-theme-linear.zip`
- 解压至站点的 `themes` 目录下
- 在 Hexo 的 `_config.yml` 中启用
# hexo配置
`hexo``_config.yml` 中调整
`Hexo` 的 `_config.yml` 中调整
## 基础配置
@ -36,8 +52,9 @@ language: en
## 文章语法高亮
关闭hexo默认的highlight.js语法高亮
```yml
# 关闭hexo默认的highlight.js语法高亮
highlight:
enable: false
line_number: true
@ -45,6 +62,7 @@ highlight:
tab_replace: ""
wrap: true
hljs: false
prismjs:
enable: true
preprocess: true
@ -53,35 +71,9 @@ prismjs:
tab_replace: ""
```
## algolia搜索
```yml
# search service
algolia:
# 替换
appId: appId
# 替换
apiKey: apiKey
# 请勿泄露,用于上报,替换
adminApiKey: adminApiKey
# 替换
SearchOnlyAPIKey: SearchOnlyAPIKey
chunkSize: 5000
# 替换
indexName: indexName
fields:
- content:strip
- categories
- date
- permalink
- slug
- tags
- title
```
# Linear主题配置
下面的配置基于 `hexo-theme-linear` 下的 `_config.yml`
下面的配置基于 `Hexo-theme-linear` 下的 `_config.yml`
## 文章分类图标
@ -94,22 +86,6 @@ postCategoryIcons:
- <svg>...</svg>
```
## 天气卡片
[和风天气API - 注册](https://id.qweather.com/#/register)
```yml
weather:
enable: true
# 替换
cityCode: cityCode
appKey: appKey
```
配置中的 `cityCode` 可以在 [官方的地区列表仓库](https://github.com/qwd/LocationList) 中的 `China-City-List-latest.csv` 找到你所在城市的 `cityCode`
## 网站图标 favicon
- 支持 `svg`
@ -197,3 +173,85 @@ valine:
# 替换
serverURLs: //xxxxxxxx.api.lncldglobal.com
```
# algolia搜索
博客自带的本地搜索,基于前端开发,存在或多或少的问题,建议换成 `algolia`,免费账户 总共有 `10,000` 条记录,每月有 `100,000` 的操作数
## 注册 & 获取 Key
1. 创建一个新的 `Index`,例如 `hex-blog`
2. 复制并保存:
- Application ID
- Search-Only API Key
- Admin API Key
- Usage API Key
[API Keys](/img/algolia-api-keys.png)
3. 替换配置
`Hexo``_config.yml` 中加入
```yml
algolia:
# 替换
appId: Application ID
# 替换
apiKey: Usage API Key
# 请勿泄露,用于上报,替换
adminApiKey: Admin API Key
# 替换
SearchOnlyAPIKey: Search-Only API Key
chunkSize: 5000
# 替换
indexName: hex-blog
fields:
- content:strip
- categories
- date
- permalink
- slug
- tags
- title
```
## 安装 hexo-algoliasearch
这是 Hexo 博客帖子索引插件,自动化提交索引到 Algolia
> 如出遇到问题,可阅读 [hexo-algoliasearch 仓库](https://www.npmjs.com/package/hexo-algoliasearch) 最新说明
安装命令:
```bash
npm install hexo-algoliasearch --save
```
## 使用 algolia
在每次博客发布之前,进行索引上传的操作,命令通常如下
```bash
hexo clean
hexo generate
hexo algolia
```
# 🇨🇳 和风天气 Widget
Linear 主要针对国内用户,在首页集成了和风天气的卡片,通过 [和风天气开发服务](https://dev.qweather.com/docs/start/) 注册
注册完成后,在配置中填入你的 `appKey``cityCode(城市代码)`
```yml
weather:
enable: true
# 替换
cityCode: cityCode
appKey: appKey
```
其中 `cityCode` 可以在 [官方的地区列表仓库](https://github.com/qwd/LocationList) 中的 `China-City-List-latest.csv` 找到你所在城市的 `cityCode`

Binary file not shown.

After

Width:  |  Height:  |  Size: 277 KiB