feat(doc): add zh-CN & en search plugin doc
parent
177a64278c
commit
2b498f2188
|
@ -14,6 +14,7 @@ jobs:
|
|||
- cp _config.theme.yml themes/icarus/_config.yml
|
||||
- ([[ -e _config.page.yml ]] && cp _config.page.yml themes/icarus/) || true
|
||||
- ([[ -e _config.post.yml ]] && cp _config.post.yml themes/icarus/) || true
|
||||
- hexo algolia
|
||||
- hexo g
|
||||
deploy:
|
||||
provider: pages
|
||||
|
|
|
@ -94,6 +94,6 @@ githubEmojis:
|
|||
className: not-gallery-item
|
||||
|
||||
algolia:
|
||||
applicationID: RYILPF5LG6
|
||||
apiKey: c358c55d21fca7cf3e935baced47bc28
|
||||
indexName: icarus
|
||||
applicationID: T0CJF4ZB1O
|
||||
apiKey: 84268949a677b7651a9f3db7da9f6952
|
||||
indexName: hexo-icarus
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
"bulma-stylus": "0.8.0",
|
||||
"hexo": "^4.0.0",
|
||||
"hexo-algolia": "^1.3.1",
|
||||
"hexo-component-inferno": "^0.2.0",
|
||||
"hexo-component-inferno": "^0.2.3",
|
||||
"hexo-deployer-git": "^2.0.0",
|
||||
"hexo-filter-github-emojis": "^2.1.0",
|
||||
"hexo-generator-archive": "^1.0.0",
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
title: Algolia Search Plugin
|
||||
date: 2013-01-01
|
||||
tags:
|
||||
- Demo
|
||||
search:
|
||||
type: algolia
|
||||
---
|
||||
|
||||
<div class="notification is-warning is-size-6">
|
||||
This is for demonstration only.
|
||||
Please report your issues with this plugin to
|
||||
<a href="https://github.com/ppoffice/hexo-component-inferno">ppoffice/hexo-component-inferno</a>.
|
||||
</div>
|
|
@ -0,0 +1,14 @@
|
|||
title: Google CSE Search Plugin
|
||||
date: 2013-01-01
|
||||
tags:
|
||||
- Demo
|
||||
search:
|
||||
type: google_cse
|
||||
cx: 006888261376761189075:qxqdcvqzio0
|
||||
---
|
||||
|
||||
<div class="notification is-warning is-size-6">
|
||||
This is for demonstration only.
|
||||
Please report your issues with this plugin to
|
||||
<a href="https://github.com/ppoffice/hexo-component-inferno">ppoffice/hexo-component-inferno</a>.
|
||||
</div>
|
|
@ -0,0 +1,160 @@
|
|||
title: Icarus User Guide - Search Plugin
|
||||
date: 2017-01-31
|
||||
categories:
|
||||
- Plugins
|
||||
- Search
|
||||
tags:
|
||||
- Icarus User Guide
|
||||
language: en
|
||||
toc: true
|
||||
---
|
||||
|
||||
<div class="notification is-success is-size-6">
|
||||
This article is also available in: <a href="{% post_path zh-CN/Search-Plugins %}">简体中文</a>.
|
||||
</div>
|
||||
|
||||
This article covers some search plugins supported by Icarus 3.
|
||||
|
||||
<!-- more -->
|
||||
|
||||
<div class="notification is-link is-size-6">
|
||||
|
||||
The search plugins of Icarus is provided by
|
||||
[ppoffice/hexo-component-inferno](https://github.com/ppoffice/hexo-component-inferno).
|
||||
Please refer to it for a complete list of supported buttons and their configurations.
|
||||
|
||||
</div>
|
||||
|
||||
## Algolia
|
||||
|
||||
<div>
|
||||
<strong>Installation Guide</strong>
|
||||
<a class="tag is-success" style="margin-left:.8em" href="{% post_path demo/search/Algolia %}">Preview</a>
|
||||
</div>
|
||||
|
||||
1. Install the [hexo-algolia](https://github.com/oncletom/hexo-algolia) plugin under the root directory of your
|
||||
Hexo site.
|
||||
|
||||
2. Register and log into [Algolia](https://www.algolia.com/).
|
||||
Click "Create Index" button on the dashboard when you log in for the first time.
|
||||
Then, enter the name of Index (Index name) and click the "Create" button to complete index creation.
|
||||
|
||||
3. Next, click "API Keys" on the left navigation bar, copy "Application ID" and "Search-Only API Key" on the page.
|
||||
Open site configuration file `_config.yml` under the root directory of your Hexo site and fill in the above
|
||||
information to the hexo-algolia plugin configurations.
|
||||
For example, the following Aloglia index information
|
||||
|
||||
{% codeblock "Algolia Index Information" %}
|
||||
Algolia Index Name: My-Hexo-Site
|
||||
Application ID: ABCDEFGHIJKL
|
||||
Search-Only API Key: 7b08fca7d42412cee901a25643124221
|
||||
{% endcodeblock %}
|
||||
|
||||
can be mapped to the following plugin configuration
|
||||
|
||||
{% codeblock _config.yml lang:yaml %}
|
||||
algolia:
|
||||
applicationID: My-Hexo-Site
|
||||
indexName: ABCDEFGHIJKL
|
||||
apiKey: 7b08fca7d42412cee901a25643124221
|
||||
{% endcodeblock %}
|
||||
|
||||
4. Go back to the "API Keys" page from the Algolia dashboard and switch to the "All API Keys" tab.
|
||||
Click the "New API Key" button.
|
||||
On the popup "Create API Key" dialog, select the index your created in the last step in "Indices" select box.
|
||||
Then, type the domain name of your site to the "HTTP Referers" field and add `addObject`, `deleteObject`,
|
||||
`listIndexes`, `deleteIndex` to the "ACL" field.
|
||||
Click the "Create" button to finish key creation.
|
||||
Copy the API key you just created, e.g., `727fbd8c998fe419318fa350db6793ca`.
|
||||
|
||||
5. Open a Windows Command Prompt (CMD) or Linux/macOS terminal and change the working directory to the root
|
||||
directory of your Hexo site.
|
||||
Set the environment variable used by the hexo-algolia plugin when upload the indices to Algolia to the
|
||||
API key you created in the last step.
|
||||
|
||||
On Windows
|
||||
|
||||
{% codeblock "Windows Command Prompt (CMD)" lang:cmd %}
|
||||
C:\Users\you> cd path/to/your/hexo/site
|
||||
C:\Users\you> set HEXO_ALGOLIA_INDEXING_KEY="727fbd8c998fe419318fa350db6793ca"
|
||||
{% endcodeblock %}
|
||||
|
||||
On Linux/macOS
|
||||
|
||||
{% codeblock "Linux/macOS Terminal" lang:shell %}
|
||||
$ cd path/to/your/hexo/site
|
||||
$ export HEXO_ALGOLIA_INDEXING_KEY="727fbd8c998fe419318fa350db6793ca"
|
||||
{% endcodeblock %}
|
||||
|
||||
Then, run the following commands to clean up your site and upload indices to Algolia
|
||||
|
||||
{% codeblock "Windows Command Prompt or Linux/macOS Terminal" lang:shell %}
|
||||
$ hexo clean
|
||||
$ hexo algolia
|
||||
{% endcodeblock %}
|
||||
|
||||
6. Finally, open theme configuration file and set the search engine to Algolia
|
||||
|
||||
{% codeblock themes/icarus/_config.yml lang:yaml %}
|
||||
search:
|
||||
type: algolia
|
||||
{% endcodeblock %}
|
||||
|
||||
|
||||
## Baidu Search
|
||||
|
||||
**Installation Guide**
|
||||
|
||||
1. Open theme configuration file and set the set the search engine to Baidu
|
||||
|
||||
{% codeblock themes/icarus/_config.yml lang:yaml %}
|
||||
search:
|
||||
type: baidu
|
||||
{% endcodeblock %}
|
||||
|
||||
|
||||
## Google Custom Search Engine (CSE)
|
||||
|
||||
<div>
|
||||
<strong>Installation Guide</strong>
|
||||
<a class="tag is-success" style="margin-left:.8em" href="{% post_path demo/search/Google-CSE %}">Preview</a>
|
||||
</div>
|
||||
|
||||
1. Log into your Google account and visit [Google CSE](https://cse.google.com/cse/create/new) to create a CSE.
|
||||
Type in the domain name of your site in the "Sites to Search" field, select correct language from the "Language"
|
||||
select box, and fill in the "Name of the search engine". Click the "Create" button to finish engine creation.
|
||||
|
||||
2. Then, click the "Get code" button on the right side of "Add it to your site". Copy the value of `cx` to the
|
||||
search settings in your theme's configuration file.
|
||||
For example, the following HTML code
|
||||
|
||||
{% codeblock "Google CSE HTML code" lang:html %}
|
||||
<script async src="https://cse.google.com/cse.js?cx=012345601234560123456:abcdefghijklmn"></script>
|
||||
<div class="gcse-search"></div>
|
||||
{% endcodeblock %}
|
||||
|
||||
can be mapped to the following theme configuration
|
||||
|
||||
{% codeblock themes/icarus/_config.yml lang:yaml %}
|
||||
search:
|
||||
type: google_cse
|
||||
cx: 012345601234560123456:abcdefghijklmn
|
||||
{% endcodeblock %}
|
||||
|
||||
|
||||
## Insight
|
||||
|
||||
**Installation Guide**
|
||||
|
||||
1. Insight is the default search engine of this site.
|
||||
You can enable it using the following theme configuration
|
||||
|
||||
{% codeblock themes/icarus/_config.yml lang:yaml %}
|
||||
search:
|
||||
type: insight
|
||||
{% endcodeblock %}
|
||||
|
||||
|
||||
<div class="notification is-warning is-size-6">
|
||||
Something wrong with this article? Click <a href="https://github.com/ppoffice/hexo-theme-icarus/edit/site/source/_posts/en/Search-Plugins.md">here</a> to submit your revision.
|
||||
</div>
|
|
@ -218,5 +218,5 @@ Please use to other services as alternatives.
|
|||
|
||||
|
||||
<div class="notification is-warning is-size-6">
|
||||
Something wrong with this article? Click <a href="https://github.com/ppoffice/hexo-theme-icarus/edit/site/source/_posts/zh-CN/Share-Buttons.md">here</a> to submit your revision.
|
||||
Something wrong with this article? Click <a href="https://github.com/ppoffice/hexo-theme-icarus/edit/site/source/_posts/en/Share-Buttons.md">here</a> to submit your revision.
|
||||
</div>
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
title: Baidu Search Plugin
|
||||
date: 2013-01-01 00:00:03
|
||||
categories:
|
||||
- Plugins
|
||||
- Search
|
||||
search:
|
||||
type: baidu
|
||||
---
|
||||
|
||||
{% codeblock lang:yaml _config.yml %}
|
||||
search:
|
||||
type: baidu
|
||||
{% endcodeblock%}
|
|
@ -1,17 +0,0 @@
|
|||
title: Google CSE Plugin
|
||||
date: 2013-01-01 00:00:02
|
||||
categories:
|
||||
- Plugins
|
||||
- Search
|
||||
search:
|
||||
type: google_cse
|
||||
cx: 006888261376761189075:qxqdcvqzio0
|
||||
---
|
||||
|
||||
[Installation instructions](https://cse.google.com/cse/create/new)
|
||||
|
||||
{% codeblock lang:yaml _config.yml %}
|
||||
search:
|
||||
type: google-cse
|
||||
cx: xxxxxxxxxxxxxxxxx # (required)
|
||||
{% endcodeblock%}
|
|
@ -1,19 +0,0 @@
|
|||
title: Insight Search Plugin
|
||||
date: 2013-01-01 00:00:01
|
||||
categories:
|
||||
- Plugins
|
||||
- Search
|
||||
tags:
|
||||
- Getting Started
|
||||
search:
|
||||
type: insight
|
||||
---
|
||||
|
||||
{% quote %}
|
||||
From Icarus 2.0.0, you no longer need to install <code>hexo-generator-json-content</code> to use the insight search plugin.
|
||||
{% endquote %}
|
||||
|
||||
{% codeblock lang:yaml _config.yml %}
|
||||
search:
|
||||
type: insight
|
||||
{% endcodeblock%}
|
|
@ -1,4 +1,4 @@
|
|||
title: Icarus用户指南 - 评论系统
|
||||
title: Icarus用户指南 - 用户评论插件
|
||||
date: 2017-01-31
|
||||
categories:
|
||||
- Plugins
|
||||
|
|
|
@ -0,0 +1,155 @@
|
|||
title: Icarus用户指南 - 站内搜索插件
|
||||
date: 2017-01-31
|
||||
categories:
|
||||
- Plugins
|
||||
- Search
|
||||
tags:
|
||||
- Icarus用户指南
|
||||
language: zh-CN
|
||||
toc: true
|
||||
---
|
||||
|
||||
<div class="notification is-success is-size-6">
|
||||
本文同时提供以下语言的翻译:<a href="{% post_path en/Search-Plugins %}">English</a>。
|
||||
</div>
|
||||
|
||||
本文介绍Icarus 3支持的一些站内搜索插件的安装配置。
|
||||
|
||||
<!-- more -->
|
||||
|
||||
<div class="notification is-link is-size-6">
|
||||
|
||||
Icarus的站内搜索插件由[ppoffice/hexo-component-inferno](https://github.com/ppoffice/hexo-component-inferno)
|
||||
提供,具体提供的插件种类与配置以其为准。
|
||||
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.content ol:not([type]) {
|
||||
list-style-type: simp-chinese-informal;
|
||||
}
|
||||
</style>
|
||||
|
||||
## Algolia
|
||||
|
||||
<div>
|
||||
<strong>安装指南</strong>
|
||||
<a class="tag is-success" style="margin-left:.8em" href="{% post_path demo/search/Algolia %}">在线预览</a>
|
||||
</div>
|
||||
|
||||
1. 在Hexo站点的根目录安装[hexo-algolia](https://github.com/oncletom/hexo-algolia)插件。
|
||||
|
||||
2. 注册并登录[Algolia](https://www.algolia.com/)。首次登录控制面板(Dashboard)时点击页面上的“创建索引”(Create Index)按钮并
|
||||
输入任意索引名称(Index name)。最后点击“创建”(Create)完成索引创建。
|
||||
|
||||
3. 下一步,点击右侧导航栏上的API Keys,复制页面上的“应用ID”(Application ID)和“仅限搜索的API Key”(Search-Only API Key)。打开
|
||||
Hexo站点根目录下的站点配置文件`_config.yml`,填入上面复制的信息到hexo-algolia插件的配置中。
|
||||
例如,对于下面的Algolia索引信息
|
||||
|
||||
{% codeblock "Algolia索引信息" %}
|
||||
Algolia索引名称: My-Hexo-Site
|
||||
Application ID: ABCDEFGHIJKL
|
||||
Search-Only API Key: 7b08fca7d42412cee901a25643124221
|
||||
{% endcodeblock %}
|
||||
|
||||
对应的站点配置为
|
||||
|
||||
{% codeblock _config.yml lang:yaml %}
|
||||
algolia:
|
||||
applicationID: My-Hexo-Site
|
||||
indexName: ABCDEFGHIJKL
|
||||
apiKey: 7b08fca7d42412cee901a25643124221
|
||||
{% endcodeblock %}
|
||||
|
||||
4. 回到Algolia控制面板的API Keys页面,切换到同一页面上的“所有API Keys”(All API Keys)标签页,点击“新建API Key”(New API Key)。
|
||||
在弹出的“创建API Key”(Create API Key)对话框中选择“索引”(Indices)为上一步中创建的索引,“HTTP Referers”填入Hexo站点的
|
||||
域名,“ACL”中填入`addObject`,`deleteObject`,`listIndexes`, `deleteIndex`四项。点击“创建”(Create)完成创建。
|
||||
复制刚刚创建的API Key,例如`727fbd8c998fe419318fa350db6793ca`。
|
||||
|
||||
5. 打开一个命令行终端(Windows命令行(CMD)或Linux/macOS终端),切换当前目录到你的Hexo站点的根目录并设置hexo-algolia
|
||||
插件上传网站索引用到的环境变量为上一步中创建的API Key。
|
||||
|
||||
Windows下
|
||||
|
||||
{% codeblock "Windows命令行(CMD)" lang:cmd %}
|
||||
C:\Users\you> cd path/to/your/hexo/site
|
||||
C:\Users\you> set HEXO_ALGOLIA_INDEXING_KEY="727fbd8c998fe419318fa350db6793ca"
|
||||
{% endcodeblock %}
|
||||
|
||||
Linux/macOS下
|
||||
|
||||
{% codeblock "Linux/macOS终端" lang:shell %}
|
||||
$ cd path/to/your/hexo/site
|
||||
$ export HEXO_ALGOLIA_INDEXING_KEY="727fbd8c998fe419318fa350db6793ca"
|
||||
{% endcodeblock %}
|
||||
|
||||
然后运行下面的命令来清理并上传网站索引到Algolia
|
||||
|
||||
{% codeblock "Windows命令行(CMD)或Linux/macOS终端" lang:shell %}
|
||||
$ hexo clean
|
||||
$ hexo algolia
|
||||
{% endcodeblock %}
|
||||
|
||||
6. 最后,打开主题配置文件并设置搜索为Algolia
|
||||
|
||||
{% codeblock themes/icarus/_config.yml lang:yaml %}
|
||||
search:
|
||||
type: algolia
|
||||
{% endcodeblock %}
|
||||
|
||||
|
||||
## 百度搜索
|
||||
|
||||
**安装指南**
|
||||
|
||||
1. 打开主题配置文件并设置搜索为百度搜索
|
||||
|
||||
{% codeblock themes/icarus/_config.yml lang:yaml %}
|
||||
search:
|
||||
type: baidu
|
||||
{% endcodeblock %}
|
||||
|
||||
|
||||
## 谷歌自定义搜索
|
||||
|
||||
<div>
|
||||
<strong>安装指南</strong>
|
||||
<a class="tag is-success" style="margin-left:.8em" href="{% post_path demo/search/Google-CSE %}">在线预览</a>
|
||||
</div>
|
||||
|
||||
1. 登录谷歌并访问[Google CSE](https://cse.google.com/cse/create/new)来创建自定义搜索。在“需要搜索的站点”(Sites to Search)
|
||||
中填入你的Hexo站点域名,“语言”(Language)选择需要的语言,并填写自定义“搜索引擎名称”(Name of the search engine)。点击“创建”
|
||||
(Create)。
|
||||
|
||||
2. 然后,点击页面上的“添加到你的站点”(Add it to your site)右侧的“获取代码”(Get code)按钮,然后从HTML代码中复制`cx`的值填入到对应
|
||||
主题配置项中。例如下面的HTML代码
|
||||
|
||||
{% codeblock "Google CSE HTML代码" lang:html %}
|
||||
<script async src="https://cse.google.com/cse.js?cx=012345601234560123456:abcdefghijklmn"></script>
|
||||
<div class="gcse-search"></div>
|
||||
{% endcodeblock %}
|
||||
|
||||
对应的主题配置为
|
||||
|
||||
{% codeblock themes/icarus/_config.yml lang:yaml %}
|
||||
search:
|
||||
type: google_cse
|
||||
cx: 012345601234560123456:abcdefghijklmn
|
||||
{% endcodeblock %}
|
||||
|
||||
|
||||
## Insight
|
||||
|
||||
**安装指南**
|
||||
|
||||
1. Insight为本站默认的站内搜索引擎。你可以通过下面的主题配置设置搜索为Insight
|
||||
|
||||
{% codeblock themes/icarus/_config.yml lang:yaml %}
|
||||
search:
|
||||
type: insight
|
||||
{% endcodeblock %}
|
||||
|
||||
|
||||
<div class="notification is-warning is-size-6">
|
||||
文章内容有误?请点击<a href="https://github.com/ppoffice/hexo-theme-icarus/edit/site/source/_posts/zh-CN/Search-Plugins.md">此处</a>提交修改。
|
||||
</div>
|
|
@ -1 +1 @@
|
|||
Subproject commit e538fa8c316f4411c8059a538122e0d04be9d84d
|
||||
Subproject commit 077780c993c67434a4c2817477806d92be998f01
|
Loading…
Reference in New Issue