Site updated: 2022-09-30 01:19:30

This commit is contained in:
qinglong
2022-09-30 01:19:31 +08:00
parent 11a50b43a7
commit 6b522d325f
47 changed files with 177 additions and 65 deletions

View File

@ -217,7 +217,22 @@ server {
<p>点击 API KEYS获取 appId 和 adminApiKey 填入 hexo 的_config.yml 中 apiKey 暂时不填。</p>
</li>
</ol>
<figure class="highlight yml"><figcaption data-lang="YAML"></figcaption><table><tr><td data-num="1"></td><td><pre><span class="token key atrule">algolia</span><span class="token punctuation">:</span></pre></td></tr><tr><td data-num="2"></td><td><pre> <span class="token key atrule">appId</span><span class="token punctuation">:</span> <span class="token comment">#Your appId</span></pre></td></tr><tr><td data-num="3"></td><td><pre> <span class="token key atrule">apiKey</span><span class="token punctuation">:</span> <span class="token comment">#Your apiKey</span></pre></td></tr><tr><td data-num="4"></td><td><pre> <span class="token key atrule">adminApiKey</span><span class="token punctuation">:</span> <span class="token comment">#Your adminApiKey</span></pre></td></tr><tr><td data-num="5"></td><td><pre> <span class="token key atrule">chunkSize</span><span class="token punctuation">:</span> <span class="token number">5000</span></pre></td></tr><tr><td data-num="6"></td><td><pre> <span class="token key atrule">indexName</span><span class="token punctuation">:</span> blog <span class="token comment">#"shoka"</span></pre></td></tr><tr><td data-num="7"></td><td><pre> <span class="token key atrule">fields</span><span class="token punctuation">:</span></pre></td></tr><tr><td data-num="8"></td><td><pre> <span class="token punctuation">-</span> title <span class="token comment">#必须配置</span></pre></td></tr><tr><td data-num="9"></td><td><pre> <span class="token punctuation">-</span> path <span class="token comment">#必须配置</span></pre></td></tr><tr><td data-num="10"></td><td><pre> <span class="token punctuation">-</span> categories <span class="token comment">#推荐配置</span></pre></td></tr><tr><td data-num="11"></td><td><pre> <span class="token punctuation">-</span> content<span class="token punctuation">:</span>strip<span class="token punctuation">:</span>truncate<span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">2000</span></pre></td></tr><tr><td data-num="12"></td><td><pre> <span class="token punctuation">-</span> gallery</pre></td></tr><tr><td data-num="13"></td><td><pre> <span class="token punctuation">-</span> photos</pre></td></tr><tr><td data-num="14"></td><td><pre> <span class="token punctuation">-</span> tags</pre></td></tr></table></figure><ol start="5">
<pre><code class="language-yml">algolia:
appId: #Your appId
apiKey: #Your apiKey
adminApiKey: #Your adminApiKey
chunkSize: 5000
indexName: blog #"shoka"
fields:
- title #必须配置
- path #必须配置
- categories #推荐配置
- content:strip:truncate,0,2000
- gallery
- photos
- tags
</code></pre>
<ol start="5">
<li>
<p>点击 All Api Keys - New Api key 创建一个 api keyIndices 选先前让记住的 indexACL 选下面图片中的选项。</p>
<p><img data-src="https://file.jingxiyuan.cn/images/2022/09/17/2022-09-17-23-47-50.png" alt="2022-09-17-23-47-50.png" /></p>
@ -391,9 +406,26 @@ server {
<p>把底部生成的配置拷入 hexo 配合文件中 (_config.yml)</p>
</li>
</ul>
<figure class="highlight yml"><figcaption data-lang="YAML"></figcaption><table><tr><td data-num="1"></td><td><pre><span class="token key atrule">admin</span><span class="token punctuation">:</span></pre></td></tr><tr><td data-num="2"></td><td><pre><span class="token key atrule">username</span><span class="token punctuation">:</span> username</pre></td></tr><tr><td data-num="3"></td><td><pre><span class="token key atrule">password_hash</span><span class="token punctuation">:</span> xxxxxx</pre></td></tr><tr><td data-num="4"></td><td><pre><span class="token key atrule">secret</span><span class="token punctuation">:</span> <span class="token string">'my super secret phrase'</span> <span class="token comment">#用单引号包裹</span></pre></td></tr><tr><td data-num="5"></td><td><pre><span class="token key atrule">deployCommand</span><span class="token punctuation">:</span> <span class="token string">'hexo_publish.sh'</span> <span class="token comment">#windows 用 hexo_publish.batlinux 用 hexo_publish.sh</span></pre></td></tr></table></figure><h4 id="hexo_publishsh"><a class="anchor" href="#hexo_publishsh">#</a> hexo_publish.sh</h4>
<figure class="highlight bash"><figcaption data-lang="bash"></figcaption><table><tr><td data-num="1"></td><td><pre><span class="token shebang important">#!/bin/bash</span></pre></td></tr><tr><td data-num="2"></td><td><pre></pre></td></tr><tr><td data-num="3"></td><td><pre>hexo clean</pre></td></tr><tr><td data-num="4"></td><td><pre>hexo g</pre></td></tr><tr><td data-num="5"></td><td><pre>hexo d</pre></td></tr></table></figure><h4 id="hexo_publishbat"><a class="anchor" href="#hexo_publishbat">#</a> hexo_publish.bat</h4>
&lt;figure class=&#34;highlight bash&#34;&gt;&lt;figcaption data-lang=&#34;bash&#34;&gt;&lt;/figcaption&gt;&lt;table&gt;&lt;tr&gt;&lt;td data-num=&#34;1&#34;&gt;&lt;/td&gt;&lt;td&gt;&lt;pre&gt;@echo off&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td data-num=&#34;2&#34;&gt;&lt;/td&gt;&lt;td&gt;&lt;pre&gt;&lt;span class=&#34;token builtin class-name&#34;&gt;cd&lt;/span&gt; D:&lt;span class=&#34;token punctuation&#34;&gt;\&lt;/span&gt;blog&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td data-num=&#34;3&#34;&gt;&lt;/td&gt;&lt;td&gt;&lt;pre&gt;d:&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td data-num=&#34;4&#34;&gt;&lt;/td&gt;&lt;td&gt;&lt;pre&gt;@cmd /c &lt;span class=&#34;token string&#34;&gt;&#34;hexo clean&amp;amp;&amp;amp; hexo g&amp;amp;&amp;amp;hexo d&amp;amp;&amp;amp;echo success&#34;&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/figure&gt;</content>
&lt;pre&gt;&lt;code class=&#34;language-yml&#34;&gt;admin:
username: username
password_hash: xxxxxx
secret: &#39;my super secret phrase&#39; #用单引号包裹
deployCommand: &#39;hexo_publish.sh&#39; #windows用hexo_publish.batlinux用hexo_publish.sh
&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&#34;hexo_publishsh&#34;&gt;&lt;a class=&#34;anchor&#34; href=&#34;#hexo_publishsh&#34;&gt;#&lt;/a&gt; hexo_publish.sh&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&#34;language-bash&#34;&gt;#!/bin/bash
hexo clean
hexo g
hexo d
&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&#34;hexo_publishbat&#34;&gt;&lt;a class=&#34;anchor&#34; href=&#34;#hexo_publishbat&#34;&gt;#&lt;/a&gt; hexo_publish.bat&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&#34;language-bash&#34;&gt;@echo off
cd D:\blog
d:
@cmd /c &amp;quot;hexo clean&amp;amp;&amp;amp; hexo g&amp;amp;&amp;amp;hexo d&amp;amp;&amp;amp;echo success&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
</content>
<category term="技术分享" scheme="https://blog.jingxiyuan.cn/categories/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/" />
<category term="心得体会" scheme="https://blog.jingxiyuan.cn/categories/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/%E5%BF%83%E5%BE%97%E4%BD%93%E4%BC%9A/" />
<category term="踩坑" scheme="https://blog.jingxiyuan.cn/categories/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/%E5%BF%83%E5%BE%97%E4%BD%93%E4%BC%9A/%E8%B8%A9%E5%9D%91/" />
@ -408,13 +440,21 @@ server &amp;#123;
<content type="html">&lt;p&gt;Welcome to &lt;span class=&#34;exturl&#34; data-url=&#34;aHR0cHM6Ly9oZXhvLmlvLw==&#34;&gt;Hexo&lt;/span&gt;! This is your very first post. Check &lt;span class=&#34;exturl&#34; data-url=&#34;aHR0cHM6Ly9oZXhvLmlvL2RvY3Mv&#34;&gt;documentation&lt;/span&gt; for more info. If you get any problems when using Hexo, you can find the answer in &lt;span class=&#34;exturl&#34; data-url=&#34;aHR0cHM6Ly9oZXhvLmlvL2RvY3MvdHJvdWJsZXNob290aW5nLmh0bWw=&#34;&gt;troubleshooting&lt;/span&gt; or you can ask me on &lt;span class=&#34;exturl&#34; data-url=&#34;aHR0cHM6Ly9naXRodWIuY29tL2hleG9qcy9oZXhvL2lzc3Vlcw==&#34;&gt;GitHub&lt;/span&gt;.&lt;/p&gt;
&lt;h2 id=&#34;quick-start&#34;&gt;&lt;a class=&#34;anchor&#34; href=&#34;#quick-start&#34;&gt;#&lt;/a&gt; Quick Start&lt;/h2&gt;
&lt;h3 id=&#34;create-a-new-post&#34;&gt;&lt;a class=&#34;anchor&#34; href=&#34;#create-a-new-post&#34;&gt;#&lt;/a&gt; Create a new post&lt;/h3&gt;
&lt;figure class=&#34;highlight bash&#34;&gt;&lt;figcaption data-lang=&#34;bash&#34;&gt;&lt;span&gt;h&lt;/span&gt;&lt;/figcaption&gt;&lt;table&gt;&lt;tr&gt;&lt;td data-num=&#34;1&#34;&gt;&lt;/td&gt;&lt;td&gt;&lt;pre&gt;$ hexo new &lt;span class=&#34;token string&#34;&gt;&#34;My New Post&#34;&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/figure&gt;&lt;p&gt;More info: &lt;span class=&#34;exturl&#34; data-url=&#34;aHR0cHM6Ly9oZXhvLmlvL2RvY3Mvd3JpdGluZy5odG1s&#34;&gt;Writing&lt;/span&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-bash&#34;&gt;$ hexo new &amp;quot;My New Post&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;More info: &lt;span class=&#34;exturl&#34; data-url=&#34;aHR0cHM6Ly9oZXhvLmlvL2RvY3Mvd3JpdGluZy5odG1s&#34;&gt;Writing&lt;/span&gt;&lt;/p&gt;
&lt;h3 id=&#34;run-server&#34;&gt;&lt;a class=&#34;anchor&#34; href=&#34;#run-server&#34;&gt;#&lt;/a&gt; Run server&lt;/h3&gt;
&lt;figure class=&#34;highlight bash&#34;&gt;&lt;figcaption data-lang=&#34;bash&#34;&gt;&lt;span&gt;h&lt;/span&gt;&lt;/figcaption&gt;&lt;table&gt;&lt;tr&gt;&lt;td data-num=&#34;1&#34;&gt;&lt;/td&gt;&lt;td&gt;&lt;pre&gt;$ hexo server&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/figure&gt;&lt;p&gt;More info: &lt;span class=&#34;exturl&#34; data-url=&#34;aHR0cHM6Ly9oZXhvLmlvL2RvY3Mvc2VydmVyLmh0bWw=&#34;&gt;Server&lt;/span&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-bash&#34;&gt;$ hexo server
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;More info: &lt;span class=&#34;exturl&#34; data-url=&#34;aHR0cHM6Ly9oZXhvLmlvL2RvY3Mvc2VydmVyLmh0bWw=&#34;&gt;Server&lt;/span&gt;&lt;/p&gt;
&lt;h3 id=&#34;generate-static-files&#34;&gt;&lt;a class=&#34;anchor&#34; href=&#34;#generate-static-files&#34;&gt;#&lt;/a&gt; Generate static files&lt;/h3&gt;
&lt;figure class=&#34;highlight bash&#34;&gt;&lt;figcaption data-lang=&#34;bash&#34;&gt;&lt;span&gt;h&lt;/span&gt;&lt;/figcaption&gt;&lt;table&gt;&lt;tr&gt;&lt;td data-num=&#34;1&#34;&gt;&lt;/td&gt;&lt;td&gt;&lt;pre&gt;$ hexo generate&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/figure&gt;&lt;p&gt;More info: &lt;span class=&#34;exturl&#34; data-url=&#34;aHR0cHM6Ly9oZXhvLmlvL2RvY3MvZ2VuZXJhdGluZy5odG1s&#34;&gt;Generating&lt;/span&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-bash&#34;&gt;$ hexo generate
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;More info: &lt;span class=&#34;exturl&#34; data-url=&#34;aHR0cHM6Ly9oZXhvLmlvL2RvY3MvZ2VuZXJhdGluZy5odG1s&#34;&gt;Generating&lt;/span&gt;&lt;/p&gt;
&lt;h3 id=&#34;deploy-to-remote-sites&#34;&gt;&lt;a class=&#34;anchor&#34; href=&#34;#deploy-to-remote-sites&#34;&gt;#&lt;/a&gt; Deploy to remote sites&lt;/h3&gt;
&lt;figure class=&#34;highlight bash&#34;&gt;&lt;figcaption data-lang=&#34;bash&#34;&gt;&lt;span&gt;h&lt;/span&gt;&lt;/figcaption&gt;&lt;table&gt;&lt;tr&gt;&lt;td data-num=&#34;1&#34;&gt;&lt;/td&gt;&lt;td&gt;&lt;pre&gt;$ hexo deploy&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/figure&gt;&lt;p&gt;More info: &lt;span class=&#34;exturl&#34; data-url=&#34;aHR0cHM6Ly9oZXhvLmlvL2RvY3Mvb25lLWNvbW1hbmQtZGVwbG95bWVudC5odG1s&#34;&gt;Deployment&lt;/span&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-bash&#34;&gt;$ hexo deploy
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;More info: &lt;span class=&#34;exturl&#34; data-url=&#34;aHR0cHM6Ly9oZXhvLmlvL2RvY3Mvb25lLWNvbW1hbmQtZGVwbG95bWVudC5odG1s&#34;&gt;Deployment&lt;/span&gt;&lt;/p&gt;
</content>
<updated>1970-01-01T00:00:00.000Z</updated>
</entry>