mirror of
https://github.com/next-theme/hexo-theme-next.git
synced 2026-01-19 18:42:34 +00:00
Update docs
This commit is contained in:
parent
ee3be0a81a
commit
3aa2a21068
10
.github/CONTRIBUTING.md
vendored
10
.github/CONTRIBUTING.md
vendored
@ -7,7 +7,7 @@
|
||||
|
||||
# <div align="center"><a title="Go to homepage" href="https://theme-next.js.org"><img align="center" width="56" height="56" src="https://raw.githubusercontent.com/next-theme/hexo-theme-next/master/source/images/logo.svg?sanitize=true"></a> e x T</div>
|
||||
|
||||
First of all, thanks for taking your time to contribute and help make our project even better than it is today! The following is a set of guidelines for contributing to [Theme Next](https://github.com/next-theme) and its libs submodules. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request.
|
||||
First of all, thanks for taking your time to contribute and help make our project even better than it is today! The following is a set of guidelines for contributing to [Theme NexT](https://github.com/next-theme) and its libs submodules. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request.
|
||||
|
||||
## Table Of Contents
|
||||
|
||||
@ -43,7 +43,7 @@ Also, you can perform a [cursory search](https://github.com/next-theme/hexo-them
|
||||
|
||||
Before submitting an Issue on GitHub, you can follow our [Quick debug instructions](https://theme-next.js.org/docs/troubleshooting.html#Quick-Debug-Instructions) to debug.
|
||||
|
||||
If you find a bug in the source code, most importantly, please check carefully if you can reproduce the problem [in the latest release version of Next](https://github.com/next-theme/hexo-theme-next/releases/latest). Then, you can help us by [Reporting Bugs](#reporting-bugs) or [Suggesting Enhancements](#suggesting-enhancements) to our [Repository](https://github.com/next-theme/hexo-theme-next). Even better, you can [submit a Pull Request](#submitting-a-pull-request) with a fix.
|
||||
If you find a bug in the source code, most importantly, please check carefully if you can reproduce the problem [in the latest release version of NexT](https://github.com/next-theme/hexo-theme-next/releases/latest). Then, you can help us by [Reporting Bugs](#reporting-bugs) or [Suggesting Enhancements](#suggesting-enhancements) to our [Repository](https://github.com/next-theme/hexo-theme-next). Even better, you can [submit a Pull Request](#submitting-a-pull-request) with a fix.
|
||||
|
||||
### Reporting Bugs
|
||||
|
||||
@ -55,8 +55,8 @@ Following these guidelines helps maintainers and the community understand your r
|
||||
* Provide more context by answering these questions:
|
||||
* Can you reproduce the problem? Can you reliably reproduce the issue? If not, provide details about how often the problem happens and under which conditions it normally happens.
|
||||
* Did the problem start happening recently or was this always a problem?
|
||||
* If the problem started happening recently, can you reproduce the problem in an older version of Next? What's the most recent version in which the problem doesn't happen? You can download older versions of Next from [the releases page](https://github.com/next-theme/hexo-theme-next/releases).
|
||||
* Which version of Node, Hexo and Next are you using? You can get the exact version by running `node -v`, `hexo version` in your terminal, or copy the contents in site's`package.json`.
|
||||
* If the problem started happening recently, can you reproduce the problem in an older version of NexT? What's the most recent version in which the problem doesn't happen? You can download older versions of NexT from [the releases page](https://github.com/next-theme/hexo-theme-next/releases).
|
||||
* Which version of Node, Hexo and NexT are you using? You can get the exact version by running `node -v`, `hexo version` in your terminal, or copy the contents in site's`package.json`.
|
||||
* Which packages do you have installed? You can get that list by copying the contents in site's`package.json`.
|
||||
* Describe the exact steps which reproduce the problem in as many details as possible. When listing steps, don't just say what you did, but explain how you did it, e.g. which command exactly you used. If you're providing snippets in the issue, use [Markdown code blocks](https://help.github.com/articles/creating-and-highlighting-code-blocks/) or [a permanent link to a code snippet](https://help.github.com/articles/creating-a-permanent-link-to-a-code-snippet/), or a [Gist link](https://gist.github.com/).
|
||||
* Provide specific examples to demonstrate the steps. Include links to files (screenshots or GIFs) or live demo.
|
||||
@ -132,7 +132,7 @@ Issues related:
|
||||
- `Polls`: An issue that initiated a poll
|
||||
- By results
|
||||
- `Duplicate`: An issue which had been mentioned
|
||||
- `Irrelevant`: An irrelevant issue for Next
|
||||
- `Irrelevant`: An irrelevant issue for NexT
|
||||
- `Invalid`: An issue that cannot be reproduced
|
||||
- `Expected Behavior`: An issue that corresponds to expected behavior
|
||||
- `Need More Info`: Need more information for solving the issue
|
||||
|
||||
14
README.md
14
README.md
@ -42,23 +42,21 @@ Or you can see [detailed installation instructions][docs-installation-url] if yo
|
||||
|
||||
## Plugins
|
||||
|
||||
NexT supports a large number of third-party plugins, which can be easily configured.
|
||||
Plugins extend and expand the functionality of NexT. There are two types of plugins: core plugins and third-party plugins. The core plugins are required by the basic functions of NexT. Third-party plugins are loaded from jsDelivr CDN by default, and they provide a large number of optional features.
|
||||
|
||||
For example, if you want to enable `pjax` on your site, just set `pjax` to `true` in NexT config file:
|
||||
Configuring these plugins is very easy. 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/next-theme/pjax
|
||||
# For more information: https://github.com/next-theme/pjax
|
||||
pjax: true
|
||||
```
|
||||
|
||||
Then visit the «Dependencies» link to get the installation instructions of this module.
|
||||
|
||||
### Configure CDN
|
||||
|
||||
If you want to specify a CDN link for any plugins, you need to set / update the CDN link.
|
||||
If you want to specify the CDN provider for any plugins, you need to set / update the CDN URL.
|
||||
|
||||
For example, if you want to use `mediumzoom` and load the plugin via CDN, go to NexT config and see:
|
||||
For example, if you want to set the CDN URL for `mediumzoom`, go to NexT config and see:
|
||||
|
||||
```yml
|
||||
vendors:
|
||||
@ -77,7 +75,7 @@ $ cd themes/next
|
||||
$ git pull
|
||||
```
|
||||
|
||||
And if you see any error message during update (something like **«Commit your changes or stash them before you can merge»**), recommended to learn [Hexo data files][docs-data-files-url] feature.\
|
||||
And if you see any error message during update (something like **«Commit your changes or stash them before you can merge»**), recommended to learn [Alternate Theme Config][docs-data-files-url] feature.\
|
||||
However, you can bypass update errors by using the `Commit`, `Stash` or `Reset` commands for local changes. See [here](https://stackoverflow.com/a/15745424/5861495) how to do it.
|
||||
|
||||
**If you want to update from v5.x / v7.x to the latest version, read [this][docs-update-5-1-x-url].**
|
||||
|
||||
@ -42,17 +42,29 @@ $ git clone https://github.com/next-theme/hexo-theme-next themes/next
|
||||
|
||||
## Плагины
|
||||
|
||||
В конфиге NexT'а теперь можно найти зависимости на каждый модуль, который был вынесен во внешние репозитории, которые могут быть найдены по [ссылке основной организации][official-plugins-url].
|
||||
Plugins extend and expand the functionality of NexT. There are two types of plugins: core plugins and third-party plugins. The core plugins are required by the basic functions of NexT. Third-party plugins are loaded from jsDelivr CDN by default, and they provide a large number of optional features.
|
||||
|
||||
Например, Вы хотите использовать `pjax` для своего сайта. Открываем конфиг NexT'а и находим:
|
||||
Configuring these plugins is very easy. Например, Вы хотите использовать `pjax` для своего сайта. Открываем конфиг NexT'а и находим:
|
||||
|
||||
```yml
|
||||
# Easily enable fast Ajax navigation on your website.
|
||||
# Dependencies: https://github.com/next-theme/pjax
|
||||
# For more information: https://github.com/next-theme/pjax
|
||||
pjax: true
|
||||
```
|
||||
|
||||
Затем включаем параметр `pjax` и переходим по ссылке «Dependencies» с дальнейшеми инструкциями по установке этого модуля.
|
||||
### Configure CDN
|
||||
|
||||
If you want to specify the CDN provider for any plugins, you need to set / update the CDN URL.
|
||||
|
||||
For example, if you want to set the CDN URL for `mediumzoom`, go to NexT config and see:
|
||||
|
||||
```yml
|
||||
vendors:
|
||||
# ...
|
||||
# Some contents...
|
||||
# ...
|
||||
mediumzoom: # Set or update mediumzoom CDN URL.
|
||||
```
|
||||
|
||||
## Обновление
|
||||
|
||||
@ -63,7 +75,7 @@ $ cd themes/next
|
||||
$ git pull
|
||||
```
|
||||
|
||||
А если всплывают ошибки во время обновления (что-то наподобии **«Commit your changes or stash them before you can merge»**), рекомендуется ознакомиться с особенностью хранения [дата-файлов в Hexo][docs-data-files-url].\
|
||||
А если всплывают ошибки во время обновления (что-то наподобии **«Commit your changes or stash them before you can merge»**), рекомендуется ознакомиться с особенностью хранения [Alternate Theme Config][docs-data-files-url].\
|
||||
Как бы то ни было, можно обойти ошибки при обновлении если «Закомитить», «Стэшнуть» или «Откатить» локальные изменения. Смотрим [здесь](https://stackoverflow.com/a/15745424/5861495) как это сделать.
|
||||
|
||||
**Если нужно обновиться с версии v5.x / v7.x на последней версиями, читаем [здесь][docs-update-5-1-x-url].**
|
||||
|
||||
@ -56,7 +56,7 @@
|
||||
* Bug 是否能够重现?是一直出现还是偶尔出现?
|
||||
* Bug 是从什么时候开始发生的?
|
||||
* 如果 Bug 突然发生,使用 [旧版本主题](https://github.com/next-theme/hexo-theme-next/releases) 是否能够重现 Bug?又是从哪个版本开始出现 Bug?
|
||||
* 你所使用 Node,Hexo 以及 Next 的版本号多少?你可以运行 `node -v` 和 `hexo version` 获取版本号,或者查看文件 `package.json` 的内容。
|
||||
* 你所使用 Node,Hexo 以及 NexT 的版本号多少?你可以运行 `node -v` 和 `hexo version` 获取版本号,或者查看文件 `package.json` 的内容。
|
||||
* 你使用了哪些插件包?查看文件 `package.json` 的内容即可获取。
|
||||
* 一步步详细你是如何重现 Bug 的,做了什么,使用了哪些功能等等。如果你需要展示代码段,请使用 [Markdown 代码块](https://help.github.com/articles/creating-and-highlighting-code-blocks/) 或 [Github 预览链接](https://help.github.com/articles/creating-a-permanent-link-to-a-code-snippet/) 或 [Gist 链接](https://gist.github.com/)。
|
||||
* 提供 Bug 的样例,如图像文件、在线演示网址等等。
|
||||
|
||||
@ -42,23 +42,21 @@ $ git clone https://github.com/next-theme/hexo-theme-next themes/next
|
||||
|
||||
## 插件
|
||||
|
||||
NexT 支持大量的第三方插件,它们可以被轻松地配置。
|
||||
插件丰富和拓展了 NexT 的功能。这些插件分为两种:核心插件和第三方插件。核心插件被 NexT 的基础功能所依赖。第三方插件默认通过 jsDelivr 的 CDN 服务加载,它们提供了大量的可选功能。
|
||||
|
||||
例如,你想要在你的站点中使用 `pjax` 插件,请进入 NexT 配置文件,启用 `pjax` 配置项:
|
||||
配置这些插件非常简单。例如,你想要在你的站点中使用 `pjax` 插件,请进入 NexT 配置文件,启用 `pjax` 配置项:
|
||||
|
||||
```yml
|
||||
# Easily enable fast Ajax navigation on your website.
|
||||
# Dependencies: https://github.com/next-theme/pjax
|
||||
# For more information: https://github.com/next-theme/pjax
|
||||
pjax: true
|
||||
```
|
||||
|
||||
然后,打开它上面的 «Dependencies» 链接以查看它的安装步骤。
|
||||
|
||||
### 设置 CDN
|
||||
|
||||
如果你想要通过 CDN 来加载插件脚本,那么需要设置相关的 CDN 链接。
|
||||
如果你想要通过自定义 CDN 而不是默认的 jsDelivr 来加载插件脚本,那么需要设置相关的 CDN 链接。
|
||||
|
||||
例如,你想要使用 `mediumzoom` 插件并通过 CDN 加载,进入 Next 配置文件并找到如下内容:
|
||||
例如,你想要为 `mediumzoom` 插件设置 CDN 地址,进入 NexT 配置文件并找到如下内容:
|
||||
|
||||
```yml
|
||||
vendors:
|
||||
@ -77,7 +75,7 @@ $ cd themes/next
|
||||
$ git pull
|
||||
```
|
||||
|
||||
如果你在此过程中收到了任何错误报告 (例如 **«Commit your changes or stash them before you can merge»**),我们推荐你使用 [Hexo 数据文件][docs-data-files-url]特性。\
|
||||
如果你在此过程中收到了任何错误报告 (例如 **«Commit your changes or stash them before you can merge»**),我们推荐你使用 [Alternate Theme Config][docs-data-files-url]特性。\
|
||||
然而你也可以通过提交(`Commit`)、贮藏(`Stash`)或忽视(`Discard`)本地更改以绕过这种更新错误。具体方法请参考[这里](https://stackoverflow.com/a/15745424/5861495)。
|
||||
|
||||
**如果你想要从 v5.x / v7.x 更新到最新版本,阅读[这篇文档][docs-update-5-1-x-url]。**
|
||||
|
||||
@ -16,7 +16,7 @@ language:
|
||||
|
||||
## Override Default Translations
|
||||
|
||||
If you would like to customize the default translation, you do not need to modify the translation files in the `languages` directory. You can override all translations using [Data files](https://hexo.io/docs/data-files).
|
||||
If you would like to customize the default translation, you do not need to modify the translation files in the `languages` directory. You can override all translations using [Data Files](https://hexo.io/docs/data-files).
|
||||
|
||||
1. Creat a `languages.yml` in `source/_data`.
|
||||
2. Insert following codes: (be careful about the two-space indent)
|
||||
|
||||
@ -24,7 +24,7 @@ hexo.extend.filter.register('template_locals', locals => {
|
||||
locals.ccURL = 'https://creativecommons.org/' + (theme.creative_commons.license === 'zero' ? 'publicdomain/zero/1.0/' : 'licenses/' + theme.creative_commons.license + '/4.0/') + (theme.creative_commons.language || '');
|
||||
// PJAX
|
||||
locals.pjax = theme.pjax ? ' data-pjax' : '';
|
||||
// Front matter
|
||||
// Front-matter
|
||||
keys.forEach(key => {
|
||||
page[key] = { ...theme[key], ...page[key] };
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user