Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenjoezhang committed Mar 11, 2020
1 parent 50ea136 commit 096aaac
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 35 deletions.
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Also, you can perform a [cursory search](https://github.com/theme-next/hexo-them

Before submitting an Issue on GitHub, you can follow the steps below to debug:

* Execute `hexo clean`, cleare the browser cache and disable all CDN services (e.g. Cloudflare Rocket Loader)
* Execute `hexo clean`, clear the browser cache and disable all CDN services (e.g. Cloudflare Rocket Loader)
* Switch to another theme and check if the bug still exists (e.g. default theme landscape). In other words, prove that this is a NexT issue, not a issue from Hexo.
* Upgrade theme NexT to the latest version.
* Upgrade Hexo and Hexo plugins to the latest version.
Expand Down
21 changes: 9 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,23 @@ Or you can see [detailed installation instructions][docs-installation-url] if yo

## Plugins

In NexT config now you can find dependencies on each module which was moved to external repositories which can be found by [main organization link][official-plugins-url].
NexT supports a large number of third-party plugins, which can be easily configured.

For example, if you want to enable `pjax` on your site, go to NexT config and see:
For example, if you want to enable `pjax` on your site, just set `pjax` to `true` in NexT config file:

```yml
# Easily enable fast Ajax navigation on your website.
# Dependencies: https://github.com/theme-next/theme-next-pjax
pjax: false
pjax: true
```
Then turn on `pjax` and go to «Dependencies» link with installation instructions of this module.
Then visit the «Dependencies» link to get the installation instructions of this module.
### Configure CDN
If you use CDN for any plugins, you need to replace your CDN link.
If you want to specify a CDN link for any plugins, you need to set / update the CDN link.
For example, if you want to use `mediumzoom` and you configured a CDN link, go to NexT config and see:
For example, if you want to use `mediumzoom` and load the plugin via CDN, go to NexT config and see:

```yml
vendors:
Expand All @@ -72,11 +72,9 @@ vendors:
mediumzoom: # Set or update mediumzoom CDN URL.
```

Instead of defining [main organization link][official-plugins-url] for updates.

## Update

You can update to latest master branch by the following command:
NexT releases new versions every month. You can update to latest master branch by the following command:

```sh
$ cd themes/next
Expand All @@ -90,10 +88,9 @@ However, you can bypass update errors by using the `Commit`, `Stash` or `Reset`

## Feedback

* Follow us with [Telegram Channel][t-news-url] for latest news.
* Visit the [Awesome NexT][awesome-next-url] list to share plugins and tutorials with other users.
* Join our [Telegram][t-chat-url] / [Gitter][gitter-url] / [Riot][riot-url] chats.
* [Add or improve translation][i18n-url] in few seconds.
* Visit the [Awesome NexT][awesome-next-url] list.
* Report a bug in [GitHub Issues][issues-bug-url].
* Request a new feature on [GitHub][issues-feat-url].
* Vote for [popular feature requests][feat-req-vote-url].
Expand All @@ -102,7 +99,7 @@ However, you can bypass update errors by using the `Commit`, `Stash` or `Reset`

We welcome you to join the development of NexT. Please see [contributing document][contributing-document-url]. 🤗

Also, we welcome Issue or PR to [official-plugins][official-plugins-url].
Also, we welcome Issue or PR to our [official-plugins][official-plugins-url].

## Contributors

Expand Down
1 change: 1 addition & 0 deletions docs/UPDATE-FROM-5.1.X.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ So, we suggest to update from version 5 to version 7 in this way:

Users upgrading to v6.0.3 and later need to explicitly modify the `language` configuration in the Hexo main config file `_config.yml`, otherwise the language display is incorrect.
5. Update Hexo and Hexo plugin

If after completing the above steps, an error occurs when executing `hexo s` or` hexo g`, it means that there may be a conflict between the old version of Hexo / Hexo plugin and the new version of the theme NexT. We recommend upgrading Hexo to versions 4.0 and higher and upgrading Hexo plugins to the latest version. You can run `npm outdated` to see all the upgradeable plugins.

And how to enable 3rd-party libraries see [here](https://github.com/theme-next/hexo-theme-next/blob/master/docs/INSTALLATION.md#plugins).
7 changes: 3 additions & 4 deletions docs/ru/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ $ git clone https://github.com/theme-next/hexo-theme-next themes/next
```yml
# Easily enable fast Ajax navigation on your website.
# Dependencies: https://github.com/theme-next/theme-next-pjax
pjax: false
pjax: true
```
Затем включаем параметр `pjax` и переходим по ссылке «Dependencies» с дальнейшеми инструкциями по установке этого модуля.

## Обновление

Можно обновить до последней мастер-ветки следующей командой:
NexT выпускает новые версии каждый месяц. Можно обновить до последней мастер-ветки следующей командой:

```sh
$ cd themes/next
Expand All @@ -74,10 +74,9 @@ $ git pull

## Обратная связь

* Подписаться на новости через [канал Telegram'а][t-news-url].
* Посетите [Awesome NexT][awesome-next-url] список.
* Вступить в наши [Telegram][t-chat-url] / [Gitter][gitter-url] / [Riot][riot-url] чаты.
* [Добавить или улучшить перевод][i18n-url] за несколько секунд.
* Посетите [Awesome NexT][awesome-next-url] список.
* Сообщить об ошибке в разделе [GitHub Issues][issues-bug-url].
* Запросить новую возможность на [GitHub][issues-feat-url].
* Голосовать за [популярные запросы возможностей][feat-req-vote-url].
Expand Down
17 changes: 7 additions & 10 deletions docs/zh-CN/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,23 @@ $ git clone https://github.com/theme-next/hexo-theme-next themes/next

## 插件

NexT 配置中有一些第三方插件,它们已经被移至外部仓库。你可以在[组织主页][official-plugins-url]中找到它们
NexT 支持大量的第三方插件,它们可以被轻松地配置

例如,你想要在你的站点中使用 `pjax` 插件,请进入 NexT 配置文件,你会看到如下内容
例如,你想要在你的站点中使用 `pjax` 插件,请进入 NexT 配置文件,启用 `pjax` 配置项

```yml
# Easily enable fast Ajax navigation on your website.
# Dependencies: https://github.com/theme-next/theme-next-pjax
pjax: false
pjax: true
```
启用 `pjax` 配置项,打开它上面的 «Dependencies» 链接以查看它的安装步骤。
然后,打开它上面的 «Dependencies» 链接以查看它的安装步骤。
### 设置 CDN
如果你想要通过 CDN 来加载插件脚本,那么需要设置相关的 CDN 链接。
例如,你使用了 `mediumzoom` 插件并且配置了 CDN 加载链接,进入 Next 配置文件,你会看到如下内容
例如,你想要使用 `mediumzoom` 插件并通过 CDN 加载,进入 Next 配置文件并找到如下内容

```yml
vendors:
Expand All @@ -72,11 +72,9 @@ vendors:
mediumzoom: # Set or update mediumzoom CDN URL.
```

通过设置 CDN 链接来代替通过[插件列表][official-plugins-url]项目进行升级。

## 更新

你可以通过如下命令更新到最新的 master 分支:
NexT 每个月都会发布新版本。你可以通过如下命令更新到最新的 master 分支:

```sh
$ cd themes/next
Expand All @@ -90,10 +88,9 @@ $ git pull

## 反馈

* 关注我们的 [Telegram Channel][t-news-url] 以获取最新消息
* 浏览 [Awesome NexT][awesome-next-url] 列表,与其它用户分享插件和教程
* 加入我们的 [Telegram][t-chat-url] / [Gitter][gitter-url] / [Riot][riot-url] 聊天。
* 请花几秒钟来[添加或修正翻译][i18n-url]。
* 浏览 [Awesome NexT][awesome-next-url] 列表。
* 在 [GitHub Issues][issues-bug-url] 报告Bug。
* 在 [GitHub][issues-feat-url] 请求新的功能。
* 为 [受欢迎的 Feature request][feat-req-vote-url] 投票。
Expand Down
1 change: 1 addition & 0 deletions docs/zh-CN/UPDATE-FROM-5.1.X.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

升级到 v6.0.3 及以后版本的用户,需要显式修改 Hexo 主配置文件 `_config.yml` 里的 `language` 配置,否则语言显示不正确。
5. 更新 Hexo 和 Hexo 插件

如果完成了以上步骤后,执行 `hexo s``hexo g` 出现错误,这意味着可能是旧版的 Hexo 和 Hexo 插件与新版的 NexT 主题产生了冲突。我们建议将 Hexo 升级至 4.0 以上的版本,将 Hexo 插件升级到最新版本。你可以执行 `npm outdated` 查看所有可以升级的插件。

关于第三方库的启用,参见[这里](https://github.com/theme-next/hexo-theme-next/blob/master/docs/zh-CN/INSTALLATION.md#插件)。
16 changes: 8 additions & 8 deletions source/js/local-search.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,8 @@ window.addEventListener('DOMContentLoaded', () => {
if (searchText.length > 0) {
// Perform local searching
datas.forEach(({ title, content, url }) => {
title = title.trim();
let titleInLowerCase = title.toLowerCase();
if (CONFIG.localsearch.unescape) {
content = unescapeHtml(content);
}
let contentInLowerCase = content.toLowerCase();
let articleUrl = decodeURIComponent(url).replace(/\/{2,}/g, '/');
let indexOfTitle = [];
let indexOfContent = [];
let searchTextCount = 0;
Expand Down Expand Up @@ -184,13 +179,13 @@ window.addEventListener('DOMContentLoaded', () => {
let resultItem = '';

if (slicesOfTitle.length !== 0) {
resultItem += `<li><a href="${articleUrl}" class="search-result-title">${highlightKeyword(title, slicesOfTitle[0])}</a>`;
resultItem += `<li><a href="${url}" class="search-result-title">${highlightKeyword(title, slicesOfTitle[0])}</a>`;
} else {
resultItem += `<li><a href="${articleUrl}" class="search-result-title">${title}</a>`;
resultItem += `<li><a href="${url}" class="search-result-title">${title}</a>`;
}

slicesOfContent.forEach(slice => {
resultItem += `<a href="${articleUrl}"><p class="search-result">${highlightKeyword(content, slice)}...</p></a>`;
resultItem += `<a href="${url}"><p class="search-result">${highlightKeyword(content, slice)}...</p></a>`;
});

resultItem += '</li>';
Expand Down Expand Up @@ -245,7 +240,12 @@ window.addEventListener('DOMContentLoaded', () => {
}) : JSON.parse(res);
// Only match articles with not empty titles
datas = datas.filter(data => data.title).map(data => {
data.title = data.title.trim();
data.content = data.content ? data.content.trim().replace(/<[^>]+>/g, '') : '';
if (CONFIG.localsearch.unescape) {
data.content = unescapeHtml(data.content);
}
data.url = decodeURIComponent(data.url).replace(/\/{2,}/g, '/');
return data;
});
});
Expand Down

0 comments on commit 096aaac

Please sign in to comment.