hexo-theme-next
Advanced tools
Comparing version 8.0.0-rc.1 to 8.0.0-rc.2
{ | ||
"extends": "theme-next", | ||
"parserOptions": { | ||
"ecmaVersion": 2018 | ||
}, | ||
"root": true | ||
} |
@@ -85,4 +85,4 @@ # <div align="center">«NexT» Authors</div> | ||
It lives on as an open source project with many contributors, a self updating list is [here](https://github.com/hexo-next/hexo-theme-next/graphs/contributors). | ||
It lives on as an open source project with many contributors, a self updating list is [here](https://github.com/next-theme/hexo-theme-next/graphs/contributors). | ||
P.S. If you did some useful pulls/commits in original repository and you are not in the list, let us know and you will be added here. |
@@ -1,13 +0,9 @@ | ||
<h1 align="center">Data Files</h1> | ||
<h1 align="center">Configuration Files</h1> | ||
Currently, it is not smooth to update NexT theme from pulling or downloading new releases. It is quite often running into conflict status when updating NexT theme via `git pull`, or need to merge configurations manually when upgrading to new releases. | ||
How to configure Hexo and NexT? The traditional approach is to store some options in site's `/_config.yml` and other options in theme's `/themes/next/_config.yml`. This approach is applicable, but it is not smooth to update NexT theme from pulling or downloading new releases. It is quite often running into conflict status when updating NexT theme via `git pull`, or need to merge configurations manually when upgrading to new releases. For the new version of Hexo, the theme can be installed through npm; it is also difficult to directly modify the theme configuration file in `node_modules`. | ||
At present, NexT encourages users to store some options in site's `/_config.yml` and other options in theme's `/themes/next/_config.yml`. This approach is applicable, but has some drawbacks: | ||
1. Configurations are splitted into two pieces | ||
2. Users may be confused which place should be for options | ||
In order to resolve this issue, Hexo provides the following solutions. Please choose only one of them and resume next steps. | ||
In order to resolve this issue, NexT provides the following two solutions. | ||
## `theme_config` | ||
<h2 align="center">Option 1: Hexo-Way</h2> | ||
With this way, all your configurations locate in main Hexo config file (`/_config.yml`), you don't need to touch `/themes/next/_config.yml` or create any new files. But you must preserve double spaces indents within `theme_config` option. | ||
@@ -19,44 +15,26 @@ | ||
1. Please confirm that the `/source/_data/next.yml` file does not exist (delete it if exists). | ||
2. Copy needed NexT theme options from theme's `/themes/next/_config.yml` into `/_config.yml`, then\ | ||
2.1. Move all this settings to the right with two spaces (in Visual Studio Code: select all strings, <kbd>CTRL</kbd> + <kbd>]</kbd>).\ | ||
2.2. Add `theme_config:` parameter above all this settings. | ||
Copy needed NexT theme options from theme's `/themes/next/_config.yml` into `/_config.yml`, then\ | ||
1. Move all this settings to the right with two spaces (in Visual Studio Code: select all strings, <kbd>CTRL</kbd> + <kbd>]</kbd>).\ | ||
2. Add `theme_config:` parameter above all this settings. | ||
### Useful links | ||
## `_config.[name].yml` | ||
* [Hexo Configuration](https://hexo.io/docs/configuration.html) | ||
* [Hexo Pull #757](https://github.com/hexojs/hexo/pull/757) | ||
With this way, all your configurations locate in config file `/_config.[name].yml`. Replace `[name]` with the value of `theme` option in Hexo config file (`/_config.yml`), e.g. `next`. | ||
<h2 align="center">Option 2: NexT-Way</h2> | ||
If there are any new options in new releases, you just need to copy those options from `/themes/next/_config.yml`, paste into this config file and set their values to whatever you want. | ||
With this way, you can put all your configurations into one place (`/source/_data/next.yml`), you don't need to touch `/themes/next/_config.yml`. | ||
But option may not accurately procces all hexo external libraries with their additional options (for example, `hexo-server` module options may be readed only in default hexo config). | ||
If there are any new options in new releases, you just need to copy those options from `/themes/next/_config.yml`, paste into `/source/_data/next.yml` and set their values to whatever you want. | ||
This method relies on Hexo [Data files](https://hexo.io/docs/data-files.html). Because Data files is introduced in Hexo 3, so you need upgrade Hexo to 3.0 (or above) to use this feature. | ||
### Usage | ||
1. Please ensure you are using Hexo 3 (or above). | ||
2. Create an file named `next.yml` in site's `/source/_data` directory (create `_data` directory if it does not exist). | ||
1. Please ensure you are using Hexo 4.3 (or above). | ||
2. Create a config file in site's root directory, e.g. `_config.next.yml`. | ||
3. Copy needed NexT theme options from theme's `/themes/next/_config.yml` into this config file. | ||
<p align="center">And after that steps there are <b>2 variants</b>, need to <b>choose only one</b> of them and <b>resume next steps</b>.</p> | ||
## `next.yml` | ||
* **Variant 1: `override: false` (default)**: | ||
Older versions of NexT theme also provide another configuration method, which is to place the theme configuration in the `/source/_data/next.yml` file. This method is deprecated, please use `_config.[name].yml` instead. If the `/source/_data/next.yml` file exists, move it to the Hexo root directory and rename it to `_config.next.yml`. | ||
1. Check your `override` option in default NexT config, it must set on `false`.\ | ||
In `next.yml` it must not be defined or set on `false` too. | ||
2. Copy needed options from both site's `/_config.yml` and theme's `/themes/next/_config.yml` into `/source/_data/next.yml`. | ||
## Useful links | ||
* **Variant 2: `override: true`**: | ||
1. In `next.yml` set `override` option on `true`. | ||
2. Copy **all** NexT theme options from theme's `/themes/next/_config.yml` into `/source/_data/next.yml`. | ||
3. Then, in main site's `/_config.yml` need to define `theme: next` option (and if needed, `source_dir: source`). | ||
4. Use standard parameters to start server, generate or deploy (`hexo clean && hexo g -d && hexo s`). | ||
### Useful links | ||
* [NexT Issue #328](https://github.com/iissnan/hexo-theme-next/issues/328) | ||
* [Hexo Configuration](https://hexo.io/docs/configuration.html) | ||
* [Hexo Pull #757](https://github.com/hexojs/hexo/pull/757) | ||
* [Hexo Pull #4120](https://github.com/hexojs/hexo/pull/4120) |
@@ -26,3 +26,3 @@ <h1 align="center">Installation</h1> | ||
$ mkdir themes/next | ||
$ curl -s https://api.github.com/repos/hexo-next/hexo-theme-next/releases/latest | grep tarball_url | cut -d '"' -f 4 | wget -i - -O- | tar -zx -C themes/next --strip-components=1 | ||
$ curl -s https://api.github.com/repos/next-theme/hexo-theme-next/releases/latest | grep tarball_url | cut -d '"' -f 4 | wget -i - -O- | tar -zx -C themes/next --strip-components=1 | ||
``` | ||
@@ -42,3 +42,3 @@ This variant will give to you **only latest release version** (without `.git` directory inside).\ | ||
$ mkdir themes/next | ||
$ curl -L https://api.github.com/repos/hexo-next/hexo-theme-next/tarball/v6.0.0 | tar -zxv -C themes/next --strip-components=1 | ||
$ curl -L https://api.github.com/repos/next-theme/hexo-theme-next/tarball/v6.0.0 | tar -zxv -C themes/next --strip-components=1 | ||
``` | ||
@@ -50,3 +50,3 @@ Same as above under `curl & tar & wget` variant, but will download **only concrete version**. | ||
```sh | ||
$ git clone --branch v6.0.0 https://github.com/hexo-next/hexo-theme-next themes/next | ||
$ git clone --branch v6.0.0 https://github.com/next-theme/hexo-theme-next themes/next | ||
``` | ||
@@ -64,3 +64,3 @@ This variant will give to you the **defined release version** (with `.git` directory inside).\ | ||
$ mkdir themes/next | ||
$ curl -L https://api.github.com/repos/hexo-next/hexo-theme-next/tarball | tar -zxv -C themes/next --strip-components=1 | ||
$ curl -L https://api.github.com/repos/next-theme/hexo-theme-next/tarball | tar -zxv -C themes/next --strip-components=1 | ||
``` | ||
@@ -73,3 +73,3 @@ Same as above under `curl & tar & wget` variant, but will download **only latest master branch version**.\ | ||
```sh | ||
$ git clone https://github.com/hexo-next/hexo-theme-next themes/next | ||
$ git clone https://github.com/next-theme/hexo-theme-next themes/next | ||
``` | ||
@@ -115,7 +115,7 @@ | ||
[download-latest-url]: https://github.com/hexo-next/hexo-theme-next/archive/master.zip | ||
[releases-latest-url]: https://github.com/hexo-next/hexo-theme-next/releases/latest | ||
[releases-url]: https://github.com/hexo-next/hexo-theme-next/releases | ||
[tags-url]: https://github.com/hexo-next/hexo-theme-next/tags | ||
[commits-url]: https://github.com/hexo-next/hexo-theme-next/commits/master | ||
[download-latest-url]: https://github.com/next-theme/hexo-theme-next/archive/master.zip | ||
[releases-latest-url]: https://github.com/next-theme/hexo-theme-next/releases/latest | ||
[releases-url]: https://github.com/next-theme/hexo-theme-next/releases | ||
[tags-url]: https://github.com/next-theme/hexo-theme-next/tags | ||
[commits-url]: https://github.com/next-theme/hexo-theme-next/commits/master | ||
@@ -126,3 +126,3 @@ [git-url]: http://lmgtfy.com/?q=linux+git+install | ||
[update-with-git-url]: https://github.com/hexo-next/hexo-theme-next/blob/master/README.md#update | ||
[docs-data-files-url]: https://github.com/hexo-next/hexo-theme-next/blob/master/docs/DATA-FILES.md | ||
[update-with-git-url]: https://github.com/next-theme/hexo-theme-next/blob/master/README.md#update | ||
[docs-data-files-url]: https://github.com/next-theme/hexo-theme-next/blob/master/docs/DATA-FILES.md |
@@ -48,3 +48,3 @@ <h1 align="center">Fix LeanCloud Counter Plugin Security Vulnerability</h1> | ||
server_url: # <your server url> | ||
# Dependencies: https://github.com/hexo-next/hexo-leancloud-counter-security | ||
# Dependencies: https://github.com/theme-next/hexo-leancloud-counter-security | ||
security: true | ||
@@ -102,3 +102,3 @@ ``` | ||
server_url: # <your server url> | ||
# Dependencies: https://github.com/hexo-next/hexo-leancloud-counter-security | ||
# Dependencies: https://github.com/theme-next/hexo-leancloud-counter-security | ||
security: true | ||
@@ -105,0 +105,0 @@ ``` |
«NexT» – Elegant and powerful theme for Hexo. | ||
Copyright © 2017 «NexT» (github.com/hexo-next/hexo-theme-next). | ||
Copyright © 2017 «NexT» (github.com/next-theme/hexo-theme-next). | ||
@@ -5,0 +5,0 @@ Detail attribution information for «NexT» |
@@ -160,8 +160,8 @@ <h1 align="center">Math Equations</h1> | ||
2. Displayed Math (i.e. `$$...$$`) needs to started with new clear line.\ | ||
In other words: you must not have any characters (except of whitespaces) **before the opening `$$` and after the ending `$$`** ([comment #32](https://github.com/hexo-next/hexo-theme-next/pull/32#issuecomment-357489509)). | ||
3. Don't support Unicode ([comment #32](https://github.com/hexo-next/hexo-theme-next/pull/32#issuecomment-357489509)). | ||
4. Inline Math (..`$...$`) must not have white spaces **after the opening `$` and before the ending `$`** ([comment #32](https://github.com/hexo-next/hexo-theme-next/pull/32#issuecomment-357489509)). | ||
In other words: you must not have any characters (except of whitespaces) **before the opening `$$` and after the ending `$$`** ([comment #32](https://github.com/theme-next/hexo-theme-next/pull/32#issuecomment-357489509)). | ||
3. Don't support Unicode ([comment #32](https://github.com/theme-next/hexo-theme-next/pull/32#issuecomment-357489509)). | ||
4. Inline Math (..`$...$`) must not have white spaces **after the opening `$` and before the ending `$`** ([comment #32](https://github.com/theme-next/hexo-theme-next/pull/32#issuecomment-357489509)). | ||
5. If you use math in Heading (i.e. `## Heading`).\ | ||
Then in corresponding TOC item it will show the related LaTex code 3 times ([comment #32](https://github.com/hexo-next/hexo-theme-next/pull/32#issuecomment-359018694)). | ||
6. If you use math in your post's title, it will not be rendered ([comment #32](https://github.com/hexo-next/hexo-theme-next/pull/32#issuecomment-359142879)). | ||
Then in corresponding TOC item it will show the related LaTex code 3 times ([comment #32](https://github.com/theme-next/hexo-theme-next/pull/32#issuecomment-359018694)). | ||
6. If you use math in your post's title, it will not be rendered ([comment #32](https://github.com/theme-next/hexo-theme-next/pull/32#issuecomment-359142879)). | ||
@@ -168,0 +168,0 @@ We currently use Katex 0.11.1, some of those bugs might be caused by the outdated version of Katex we use. |
@@ -26,3 +26,3 @@ <h1 align="center">Установка</h1> | ||
$ mkdir themes/next | ||
$ curl -s https://api.github.com/repos/hexo-next/hexo-theme-next/releases/latest | grep tarball_url | cut -d '"' -f 4 | wget -i - -O- | tar -zx -C themes/next --strip-components=1 | ||
$ curl -s https://api.github.com/repos/next-theme/hexo-theme-next/releases/latest | grep tarball_url | cut -d '"' -f 4 | wget -i - -O- | tar -zx -C themes/next --strip-components=1 | ||
``` | ||
@@ -42,3 +42,3 @@ Этим способом Вы скачаете **только последнюю версию релиза** (без директории `.git` внутри).\ | ||
$ mkdir themes/next | ||
$ curl -L https://api.github.com/repos/hexo-next/hexo-theme-next/tarball/v6.0.0 | tar -zxv -C themes/next --strip-components=1 | ||
$ curl -L https://api.github.com/repos/next-theme/hexo-theme-next/tarball/v6.0.0 | tar -zxv -C themes/next --strip-components=1 | ||
``` | ||
@@ -50,3 +50,3 @@ То же, что и описано выше в способе `curl & tar & wget`, но скачает **только конкретную версию**. | ||
```sh | ||
$ git clone --branch v6.0.0 https://github.com/hexo-next/hexo-theme-next themes/next | ||
$ git clone --branch v6.0.0 https://github.com/next-theme/hexo-theme-next themes/next | ||
``` | ||
@@ -64,3 +64,3 @@ Этот вариант скачает **указанную версию релиза** (включая директорию `.git` внутри).\ | ||
$ mkdir themes/next | ||
$ curl -L https://api.github.com/repos/hexo-next/hexo-theme-next/tarball | tar -zxv -C themes/next --strip-components=1 | ||
$ curl -L https://api.github.com/repos/next-theme/hexo-theme-next/tarball | tar -zxv -C themes/next --strip-components=1 | ||
``` | ||
@@ -73,3 +73,3 @@ То же, что и описано выше в варианте `curl & tar & wget`, но скачает **только последнюю мастер-ветку**.\ | ||
```sh | ||
$ git clone https://github.com/hexo-next/hexo-theme-next themes/next | ||
$ git clone https://github.com/next-theme/hexo-theme-next themes/next | ||
``` | ||
@@ -115,7 +115,7 @@ | ||
[download-latest-url]: https://github.com/hexo-next/hexo-theme-next/archive/master.zip | ||
[releases-latest-url]: https://github.com/hexo-next/hexo-theme-next/releases/latest | ||
[releases-url]: https://github.com/hexo-next/hexo-theme-next/releases | ||
[tags-url]: https://github.com/hexo-next/hexo-theme-next/tags | ||
[commits-url]: https://github.com/hexo-next/hexo-theme-next/commits/master | ||
[download-latest-url]: https://github.com/next-theme/hexo-theme-next/archive/master.zip | ||
[releases-latest-url]: https://github.com/next-theme/hexo-theme-next/releases/latest | ||
[releases-url]: https://github.com/next-theme/hexo-theme-next/releases | ||
[tags-url]: https://github.com/next-theme/hexo-theme-next/tags | ||
[commits-url]: https://github.com/next-theme/hexo-theme-next/commits/master | ||
@@ -126,3 +126,3 @@ [git-url]: http://lmgtfy.com/?q=linux+git+install | ||
[update-with-git-url]: https://github.com/hexo-next/hexo-theme-next/blob/master/docs/ru/README.md#%D0%A3%D1%81%D1%82%D0%B0%D0%BD%D0%BE%D0%B2%D0%BA%D0%B0 | ||
[docs-data-files-url]: https://github.com/hexo-next/hexo-theme-next/blob/master/docs/ru/DATA-FILES.md | ||
[update-with-git-url]: https://github.com/next-theme/hexo-theme-next/blob/master/docs/ru/README.md#%D0%A3%D1%81%D1%82%D0%B0%D0%BD%D0%BE%D0%B2%D0%BA%D0%B0 | ||
[docs-data-files-url]: https://github.com/next-theme/hexo-theme-next/blob/master/docs/ru/DATA-FILES.md |
@@ -8,3 +8,3 @@ <div align="right"> | ||
# <div align="center"><a title="Репозиторий сайта NexT" href="https://github.com/hexo-next/theme-next.org"><img align="center" width="56" height="56" src="https://raw.githubusercontent.com/hexo-next/hexo-theme-next/master/source/images/logo.svg?sanitize=true"></a> e x T</div> | ||
# <div align="center"><a title="Репозиторий сайта NexT" href="https://github.com/next-theme/theme-next.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> | ||
@@ -15,12 +15,8 @@ <p align="center"> | ||
<br> | ||
<a href="https://www.npmjs.com/package/hexo-theme-next"><img src="https://img.shields.io/github/package-json/v/hexo-next/hexo-theme-next?style=flat-square"></a> | ||
<a href="https://www.npmjs.com/package/hexo-theme-next"><img src="https://img.shields.io/npm/v/hexo-theme-next?style=flat-square"></a> | ||
<a href="https://nodejs.org"><img src="https://img.shields.io/badge/node-%3E=10.9.0-green?style=flat-square"></a> | ||
<a href="https://hexo.io"><img src="https://img.shields.io/badge/hexo-%3E=4.0.0-blue?style=flat-square&logo=hexo"></a> | ||
<a href="https://github.com/hexo-next/hexo-theme-next/blob/master/LICENSE.md"><img src="https://img.shields.io/badge/license-%20AGPL-orange?style=flat-square&logo=gnu"></a> | ||
<a href="https://github.com/next-theme/hexo-theme-next/blob/master/LICENSE.md"><img src="https://img.shields.io/badge/license-%20AGPL-orange?style=flat-square&logo=gnu"></a> | ||
<img src="https://img.shields.io/github/workflow/status/next-theme/hexo-theme-next/Linter?style=flat-square"> | ||
<br> | ||
<a href="https://bestpractices.coreinfrastructure.org/projects/2625"><img src="https://img.shields.io/cii/level/2625?style=flat-square" title="Инициатива базовой инфраструктуры: передовой опыт"></a> | ||
<a href="https://travis-ci.org/hexo-next/hexo-theme-next?branch=master"><img src="https://img.shields.io/travis/hexo-next/hexo-theme-next/master?style=flat-square&logo=travis%20ci" title="Travis CI [Linux]"></a> | ||
<a href="https://app.codacy.com/manual/hexo-next/hexo-theme-next/dashboard"><img src="https://img.shields.io/codacy/grade/72f7fe7609c2438a92069f448e5a341a/master?style=flat-square&logo=codacy" title="Оценка проекта"></a> | ||
<img src="https://img.shields.io/snyk/vulnerabilities/github/hexo-next/hexo-theme-next?style=flat-square" title="Vulnerabilities"> | ||
<br> | ||
<img src="https://user-images.githubusercontent.com/16272760/63487983-da41b080-c4df-11e9-951c-64883a8a5e9b.png"> | ||
@@ -35,3 +31,3 @@ </p> | ||
<br> | ||
Больше примеров «NexT» <a href="https://github.com/hexo-next/awesome-next#live-preview">здесь</a>. | ||
Больше примеров «NexT» <a href="https://github.com/next-theme/awesome-next#live-preview">здесь</a>. | ||
</p> | ||
@@ -45,3 +41,3 @@ | ||
$ cd hexo | ||
$ git clone https://github.com/hexo-next/hexo-theme-next themes/next | ||
$ git clone https://github.com/next-theme/hexo-theme-next themes/next | ||
``` | ||
@@ -59,3 +55,3 @@ | ||
# Easily enable fast Ajax navigation on your website. | ||
# Dependencies: https://github.com/hexo-next/theme-next-pjax | ||
# Dependencies: https://github.com/next-theme/pjax | ||
pjax: true | ||
@@ -102,6 +98,4 @@ ``` | ||
<a href="https://github.com"><img align="center" width="100" src="https://github.githubassets.com/images/modules/logos_page/GitHub-Logo.png"></a> | ||
| ||
<a href="https://www.netlify.com"><img align="center" width="150" src="https://cdn.netlify.com/15ecf59b59c9d04b88097c6b5d2c7e8a7d1302d0/1b6d6/img/press/logos/full-logo-light.svg"></a> | ||
<br> | ||
<sub>GitHub позволяет нам хостить Git-репозиторий, Netlify позволяет нам деплоить документацию.</sub> | ||
<sub>GitHub позволяет нам хостить Git-репозиторий и деплоить документацию.</sub> | ||
<br> | ||
@@ -112,16 +106,8 @@ <br> | ||
<sub>Crowdin позволяет нам удобно переводить документацию.</sub> | ||
<br> | ||
<br> | ||
<a href="https://codacy.com"><img align="center" width="155" src="https://user-images.githubusercontent.com/16944225/55026017-623f8f00-5002-11e9-88bf-0d6a5884c6c2.png"></a> | ||
| ||
<a href="https://travis-ci.com"><img align="center" width="140" src="https://raw.githubusercontent.com/travis-ci/travis-web/master/public/images/logos/TravisCI-Full-Color.png"></a> | ||
<br> | ||
<sub>Codacy позволяет нам контролировать качество кода, Travis CI позволяет нам запускать набор тестов.</sub> | ||
</p> | ||
[docs-installation-url]: https://github.com/hexo-next/hexo-theme-next/blob/master/docs/ru/INSTALLATION.md | ||
[docs-data-files-url]: https://github.com/hexo-next/hexo-theme-next/blob/master/docs/ru/DATA-FILES.md | ||
[docs-update-5-1-x-url]: https://github.com/hexo-next/hexo-theme-next/blob/master/docs/ru/UPDATE-FROM-5.1.X.md | ||
[docs-installation-url]: https://github.com/next-theme/hexo-theme-next/blob/master/docs/ru/INSTALLATION.md | ||
[docs-data-files-url]: https://github.com/next-theme/hexo-theme-next/blob/master/docs/ru/DATA-FILES.md | ||
[docs-update-5-1-x-url]: https://github.com/next-theme/hexo-theme-next/blob/master/docs/ru/UPDATE-FROM-5.1.X.md | ||
[t-news-url]: https://t.me/theme_next_news | ||
[t-chat-url]: https://t.me/theme_next | ||
@@ -132,10 +118,10 @@ [gitter-url]: https://gitter.im/theme-next | ||
[awesome-next-url]: https://github.com/hexo-next/awesome-next | ||
[issues-bug-url]: https://github.com/hexo-next/hexo-theme-next/issues/new?assignees=&labels=Bug&template=bug-report.md | ||
[issues-feat-url]: https://github.com/hexo-next/hexo-theme-next/issues/new?assignees=&labels=Feature+Request&template=feature-request.md | ||
[feat-req-vote-url]: https://github.com/hexo-next/hexo-theme-next/issues?q=is%3Aopen+is%3Aissue+label%3A%22Feature+Request%22 | ||
[awesome-next-url]: https://github.com/next-theme/awesome-next | ||
[issues-bug-url]: https://github.com/next-theme/hexo-theme-next/issues/new?assignees=&labels=Bug&template=bug-report.md | ||
[issues-feat-url]: https://github.com/next-theme/hexo-theme-next/issues/new?assignees=&labels=Feature+Request&template=feature-request.md | ||
[feat-req-vote-url]: https://github.com/next-theme/hexo-theme-next/issues?q=is%3Aopen+is%3Aissue+label%3A%22Feature+Request%22 | ||
[contributing-document-url]: https://github.com/hexo-next/hexo-theme-next/blob/master/.github/CONTRIBUTING.md | ||
[contributing-document-url]: https://github.com/next-theme/hexo-theme-next/blob/master/.github/CONTRIBUTING.md | ||
[official-plugins-url]: https://github.com/theme-next | ||
[contributors-image]: https://opencollective.com/hexo-next/contributors.svg?width=890 | ||
[contributors-url]: https://github.com/hexo-next/hexo-theme-next/graphs/contributors | ||
[contributors-image]: https://opencollective.com/next-theme/contributors.svg?width=890 | ||
[contributors-url]: https://github.com/next-theme/hexo-theme-next/graphs/contributors |
@@ -6,3 +6,3 @@ <h1 align="center">Обновление из-под NexT v5.1.x</h1> | ||
2. Большинство библиотек в `next/source/lib` директории были вынесены в [отдельные репозитории под организацией NexT](https://github.com/theme-next). | ||
3. 3rd-party плагин [`hexo-wordcount`](https://github.com/willin/hexo-wordcount) был заменён на [`hexo-symbols-count-time`](https://github.com/hexo-next/hexo-symbols-count-time) т.к. `hexo-symbols-count-time` не имеет никаких сторонних Node.js зависимостей, не имеет [языкового фильтра](https://github.com/willin/hexo-wordcount/issues/7) что обеспечивает улучшенную производительность при генерации сайта. | ||
3. 3rd-party плагин [`hexo-wordcount`](https://github.com/willin/hexo-wordcount) был заменён на [`hexo-symbols-count-time`](https://github.com/next-theme/hexo-symbols-count-time) т.к. `hexo-symbols-count-time` не имеет никаких сторонних Node.js зависимостей, не имеет [языкового фильтра](https://github.com/willin/hexo-wordcount/issues/7) что обеспечивает улучшенную производительность при генерации сайта. | ||
@@ -16,5 +16,5 @@ Поэтому, я предлагаю обновиться с версии 5 на версию 7 следующим способом: | ||
1.4. Любые другие всевозможные пользовательские изменения, которые могут быть найдены любым инструментом для сравнения файлов. | ||
2. Склонировать новый репозиторий в любую другую директорию, отличную от `next`. Например, в директорию `next-reloaded`: `git clone https://github.com/hexo-next/hexo-theme-next themes/next-reloaded`. Итак, нет необходимости трогать старую NexT 5.1.x директорию и можно работать с новой `next-reloaded`. | ||
2. Склонировать новый репозиторий в любую другую директорию, отличную от `next`. Например, в директорию `next-reloaded`: `git clone https://github.com/next-theme/hexo-theme-next themes/next-reloaded`. Итак, нет необходимости трогать старую NexT 5.1.x директорию и можно работать с новой `next-reloaded`. | ||
3. Открываем главную Hexo-конфигурацию и устанавливаем параметр темы: `theme: next-reloaded`. Так Ваша директория `next-reloaded` должна грузиться при генерации. Если Вы будете наблюдать какие-либо баги или Вам попросту не нравится эта новая версия, в любой момент Вы можете использовать старую 5.1.x. | ||
А как активировать 3rd-party библиотеки, смотрим здесь [здесь](https://github.com/hexo-next/hexo-theme-next/blob/master/docs/ru/INSTALLATION.md#%D0%9F%D0%BB%D0%B0%D0%B3%D0%B8%D0%BD%D1%8B). | ||
А как активировать 3rd-party библиотеки, смотрим здесь [здесь](https://github.com/next-theme/hexo-theme-next/blob/master/docs/ru/INSTALLATION.md#%D0%9F%D0%BB%D0%B0%D0%B3%D0%B8%D0%BD%D1%8B). |
<h1 align="center">Update from NexT v5.1.x</h1> | ||
NexT version 5 works fine with Hexo 3, but for frequent users, you maybe need to upgrade version 5 to 7 to get features and supports in new [Theme-Next](https://github.com/hexo-next/hexo-theme-next) repository. | ||
NexT version 5 works fine with Hexo 3, but for frequent users, you maybe need to upgrade version 5 to 7 to get features and supports in new [Theme-Next](https://github.com/next-theme/hexo-theme-next) repository. | ||
@@ -9,3 +9,3 @@ There are no hard breaking changes between 5.1.x and the latest version. It's change major version to 7 because: | ||
2. Most libraries under the `next/source/lib` directory was moved out to [external repos under NexT organization](https://github.com/theme-next). | ||
3. 3rd-party plugin [`hexo-wordcount`](https://github.com/willin/hexo-wordcount) was replaced by [`hexo-symbols-count-time`](https://github.com/hexo-next/hexo-symbols-count-time) because `hexo-symbols-count-time` no have any external Node.js dependencies, no have [language filter](https://github.com/willin/hexo-wordcount/issues/7) which causes better performance on speed at site generation. | ||
3. 3rd-party plugin [`hexo-wordcount`](https://github.com/willin/hexo-wordcount) was replaced by [`hexo-symbols-count-time`](https://github.com/next-theme/hexo-symbols-count-time) because `hexo-symbols-count-time` no have any external Node.js dependencies, no have [language filter](https://github.com/willin/hexo-wordcount/issues/7) which causes better performance on speed at site generation. | ||
@@ -19,7 +19,7 @@ So, we suggest to update from version 5 to version 7 in this way: | ||
1.4. Any another possible custom additions which can be finded by compare tools between repos. | ||
2. Clone new repo to any another directory instead of `next`. For example, in `next-reloaded` directory: `git clone https://github.com/hexo-next/hexo-theme-next themes/next-reloaded`. So, you don't touch your old NexT 5.1.x directory and can work with new `next-reloaded` dir. | ||
2. Clone new repo to any another directory instead of `next`. For example, in `next-reloaded` directory: `git clone https://github.com/next-theme/hexo-theme-next themes/next-reloaded`. So, you don't touch your old NexT 5.1.x directory and can work with new `next-reloaded` dir. | ||
3. Go to Hexo main config and set theme parameter: `theme: next-reloaded`. So, your `next-reloaded` directory must loading with your generation. If you may see any bugs or you simply not like this version, you anytime can switch for 5.1.x version back. | ||
4. Update language configuration (For Chinese) | ||
Since v6.0.3, `zh-Hans` has been renamed to `zh-CN`: https://github.com/hexo-next/hexo-theme-next/releases/tag/v6.0.3 | ||
Since v6.0.3, `zh-Hans` has been renamed to `zh-CN`: https://github.com/next-theme/hexo-theme-next/releases/tag/v6.0.3 | ||
@@ -31,2 +31,2 @@ 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. | ||
And how to enable 3rd-party libraries see [here](https://github.com/hexo-next/hexo-theme-next/blob/master/docs/INSTALLATION.md#plugins). | ||
And how to enable 3rd-party libraries see [here](https://github.com/next-theme/hexo-theme-next/blob/master/docs/INSTALLATION.md#plugins). |
@@ -8,7 +8,7 @@ <div align="right"> | ||
# <div align="center"><a title="Go to homepage" href="https://theme-next.org"><img align="center" width="56" height="56" src="https://raw.githubusercontent.com/hexo-next/hexo-theme-next/master/source/images/logo.svg?sanitize=true"></a> e x T</div> | ||
# <div align="center"><a title="Go to homepage" href="https://theme-next.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> | ||
[NexT](https://theme-next.org) 是一个优雅而强大的 [Hexo](https://hexo.io/)主题。在这里,您可以构建一个托管在 [GitHub Pages](https://pages.github.com/) 上的静态博客,分享您的生活,并与新朋友进行交流。 | ||
参与者公约用来约束在 [NexT](https://github.com/hexo-next/hexo-theme-next) 社区中代码更新、问题交流、请求合并等行为。我们期望所有用户相互尊重,礼貌待人。任何违反这些规则的人都将不会被审核,并会在发现后立即被阻止和驱逐。 | ||
参与者公约用来约束在 [NexT](https://github.com/next-theme/hexo-theme-next) 社区中代码更新、问题交流、请求合并等行为。我们期望所有用户相互尊重,礼貌待人。任何违反这些规则的人都将不会被审核,并会在发现后立即被阻止和驱逐。 | ||
@@ -15,0 +15,0 @@ ## 目录 |
@@ -8,3 +8,3 @@ <div align="right"> | ||
# <div align="center"><a title="Go to homepage" href="https://theme-next.org"><img align="center" width="56" height="56" src="https://raw.githubusercontent.com/hexo-next/hexo-theme-next/master/source/images/logo.svg?sanitize=true"></a> e x T</div> | ||
# <div align="center"><a title="Go to homepage" href="https://theme-next.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> | ||
@@ -41,3 +41,3 @@ 首先,非常感谢大家抽出宝贵时间来让我们的 NexT 主题越变越好。在这里,我们介绍一下 [NexT 主题及其子模块](https://github.com/theme-next) 的开源贡献指南。不过,我们希望大家不要局限于此,更欢迎大家随时进行补充。 | ||
另外,你也可以通过 [这里](https://github.com/hexo-next/hexo-theme-next/search?q=&type=Issues&utf8=%E2%9C%93) 进行大致检索,有些问题已经得到解答,你可以自行解决。对于没有解决的 Issue,你也可以继续提问。 | ||
另外,你也可以通过 [这里](https://github.com/next-theme/hexo-theme-next/search?q=&type=Issues&utf8=%E2%9C%93) 进行大致检索,有些问题已经得到解答,你可以自行解决。对于没有解决的 Issue,你也可以继续提问。 | ||
@@ -57,3 +57,3 @@ #### 快速调试指南 | ||
如果你在使用过程中发现了 Bug,请再次确认 Bug 在 [最新发布版本](https://github.com/hexo-next/hexo-theme-next/releases/latest) 中是否重现。如果 Bug 重现,欢迎你到我们的 [主题仓库](https://github.com/hexo-next/hexo-theme-next) 中 [反馈 Bug](#reporting-bugs) 或者 [提交功能需求](#提交功能需求),也更期待您 [提交合并请求](#提交合并请求)。 | ||
如果你在使用过程中发现了 Bug,请再次确认 Bug 在 [最新发布版本](https://github.com/next-theme/hexo-theme-next/releases/latest) 中是否重现。如果 Bug 重现,欢迎你到我们的 [主题仓库](https://github.com/next-theme/hexo-theme-next) 中 [反馈 Bug](#reporting-bugs) 或者 [提交功能需求](#提交功能需求),也更期待您 [提交合并请求](#提交合并请求)。 | ||
@@ -70,3 +70,3 @@ ### 反馈 Bug | ||
* Bug 是从什么时候开始发生的? | ||
* 如果 Bug 突然发生,使用 [旧版本主题](https://github.com/hexo-next/hexo-theme-next/releases) 是否能够重现 Bug?又是从哪个版本开始出现 Bug? | ||
* 如果 Bug 突然发生,使用 [旧版本主题](https://github.com/next-theme/hexo-theme-next/releases) 是否能够重现 Bug?又是从哪个版本开始出现 Bug? | ||
* 你所使用 Node,Hexo 以及 Next 的版本号多少?你可以运行 `node -v` 和 `hexo version` 获取版本号,或者查看文件 `package.json` 的内容。 | ||
@@ -111,3 +111,3 @@ * 你使用了哪些插件包?查看文件 `package.json` 的内容即可获取。 | ||
1. 进入 GitHub 项目主页,点击 **Releases** 和 **Draft a new release**。 | ||
2. 输入你需要发布的版本号。版本控制是基于 [Git tags](https://git-scm.com/book/en/Git-Basics-Tagging) 工作的,建议按照 [About Major and Minor NexT versions](https://github.com/hexo-next/hexo-theme-next/issues/187) 确定版本号。 | ||
2. 输入你需要发布的版本号。版本控制是基于 [Git tags](https://git-scm.com/book/en/Git-Basics-Tagging) 工作的,建议按照 [About Major and Minor NexT versions](https://github.com/theme-next/hexo-theme-next/issues/187) 确定版本号。 | ||
3. 确定你需要发布的分支。除非发布测试版本,通常情况下选择 `master` 分支。 | ||
@@ -114,0 +114,0 @@ 4. 输入发布版本的标题和说明。 |
@@ -1,61 +0,39 @@ | ||
<h1 align="center">数据文件</h1> | ||
<h1 align="center">配置文件</h1> | ||
目前,通过 pull 或下载新的 release 版本来更新 NexT 主题的体验并不平滑。当用户使用 `git pull` 更新 NexT 主题时经常需要解决冲突问题,而在手动下载 release 版本时也经常需要手动合并配置。 | ||
如何配置 Hexo 和 NexT?传统的做法是存储部分配置在 Hexo 站点配置文件(`/_config.yml`),而另一部分在主题配置文件(`/themes/next/_config.yml`)。这一方式固然可用,但通过 `git pull` 或下载新的 release 版本来更新 NexT 主题的体验并不平滑。当用户使用 `git pull` 更新 NexT 主题时经常需要解决冲突问题,而在手动下载 release 版本时也经常需要手动合并配置。对于新版本的 Hexo,主题可以通过 npm 安装;直接修改 `node_modules` 中的主题配置文件同样是困难的。 | ||
现在来说,NexT 推荐用户存储部分配置在 Hexo 站点配置文件(`/_config.yml`),而另一部分在主题配置文件(`/themes/next/_config.yml`)。这一方式固然可用,但也有一些缺点: | ||
1. 配置项被分裂为两部分; | ||
2. 用户难以弄清何处存放配置选项。 | ||
为了解决这一问题,Hexo 提供了以下这些方案。请任选其一,然后继续后面的步骤。 | ||
为了解决这一问题,NexT 提供了以下两种方案。 | ||
## `theme_config` 方式 | ||
<h2 align="center">选择 1:Hexo 方式</h2> | ||
使用这一方式,你的全部配置都将置于 Hexo 站点配置文件(`/_config.yml`)中,并且不需要修改 `/themes/next/_config.yml`,或者创建什么其他的文件。但是所有用到的主题选项必须放置在 `theme_config` 后,并全部增加两个空格的缩进。 | ||
使用这一方式,你的全部配置都将置于 Hexo 站点配置文件(`/_config.yml`),并且不需要修改 `/themes/next/_config.yml`,或者创建什么其他的文件。但是所有用到的主题选项必须放置在 `theme_config` 后,并全部增加两个空格的缩进。 | ||
如果在新的 release 中新增了选项,那么你只需要从 `/themes/next/_config.yml` 中将它们复制到 `/_config.yml` 中并将它们的值设置为你想要的。 | ||
如果在新的 release 中新增了选项,那么你只需要从 `/themes/next/_config.yml` 中将他们复制到 `/_config.yml` 中并将它们的值设置为你想要的。 | ||
### 用法 | ||
1. 请确认不存在 `/source/_data/next.yml` 文件(如果已存在,请删除) | ||
2. 从主题的 `/themes/next/_config.yml` 文件中复制你需要的 NexT 配置项到 `/_config.yml` 中,然后\ | ||
2.1. 所有这些配置项右移两个空格(在 Visual Studio Code 中:选中这些文字,<kbd>CTRL</kbd> + <kbd>]</kbd>)。\ | ||
2.2. 在这些参数最上方添加一行 `theme_config:`。 | ||
从主题的 `/themes/next/_config.yml` 文件中复制你需要的 NexT 配置项到 `/_config.yml` 中,然后\ | ||
1. 所有这些配置项右移两个空格(在 Visual Studio Code 中:选中这些文字,<kbd>CTRL</kbd> + <kbd>]</kbd>)。\ | ||
2. 在这些参数最上方添加一行 `theme_config:`。 | ||
### 相关链接 | ||
## `_config.[name].yml` 方式 | ||
* [Hexo 配置](https://hexo.io/zh-cn/docs/configuration.html) | ||
* [Hexo Pull #757](https://github.com/hexojs/hexo/pull/757) | ||
使用这一方式,你的主题配置将置于配置文件 `/_config.[name].yml` 中。这里的 `[name]` 需要替换为 Hexo 站点配置文件(`/_config.yml`)中 `theme` 项的名字,例如 `next`。 | ||
<h2 align="center">选择 2: NexT 方式</h2> | ||
如果在新的 release 中新增了选项,那么你只需要从 `/themes/next/_config.yml` 中将它们复制到此配置文件中并将它们的值设置为你想要的。 | ||
使用这一方式,你现在可以将你的全部配置置于同一位置(`/source/_data/next.yml`),并且不需要修改 `/themes/next/_config.yml`。 | ||
但是可能无法让所有 Hexo 外部库都准确处理它们的附加选项(举个例子,`hexo-server` 模块只会从 Hexo 默认配置文件中读取选项)。 | ||
如果在新的 release 中出现了任何新的选项,那么你只需要从 `/themes/next/_config.yml` 中将他们复制到 `/source/_data/next.yml` 中并设置它们的值为你想要的选项。 | ||
这一方法依赖于 Hexo 的[数据文件](https://hexo.io/docs/data-files.html)特性。因为数据文件是在 Hexo 3 中被引入,所以你需要更新至 Hexo 3.0 以后的版本来使用这一特性。 | ||
### 用法 | ||
1. 请确认你的 Hexo 版本为 3.0 或更高。 | ||
2. 在你站点的 `/source/_data` 目录创建一个 `next.yml` 文件(如果 `_data` 目录不存在,请创建之)。 | ||
1. 请确认你的 Hexo 版本为 4.3 或更高。 | ||
2. 根据你所使用的 NexT 主题的名字,在 Hexo 根目录下创建配置文件,例如 `_config.next.yml`。 | ||
3. 从主题的 `/themes/next/_config.yml` 文件中复制你需要的 NexT 配置项到此配置文件中。 | ||
<p align="center">以上步骤之后有 <b>两种选择</b>,请<b>任选其一</b>然后<b>继续后面的步骤</b>。</p> | ||
## `next.yml` 方式 | ||
* **选择 1:`override: false`(默认)**: | ||
较旧版本的 NexT 主题还提供了另一种配置方法,那就是将主题配置放置在 `/source/_data/next.yml` 文件中。这一方法已经废弃,请使用 `_config.[name].yml` 方式替代。如果存在 `/source/_data/next.yml` 文件,请将其移动到 Hexo 根目录并重命名为 `_config.next.yml`。 | ||
1. 检查默认 NexT 配置中的 `override` 选项,必须设置为 `false`。\ | ||
在 `next.yml` 文件中,也要设置为 `false`,或者不定义此选项。 | ||
2. 从站点配置文件(`/_config.yml`)与主题配置文件(`/themes/next/_config.yml`)中复制你需要的选项到 `/source/_data/next.yml` 中。 | ||
## 相关链接 | ||
* **选择 2:`override: true`**: | ||
1. 在 `next.yml` 中设置 `override` 选项为 `true`。 | ||
2. 从 `/themes/next/_config.yml` 配置文件中复制**所有**的 NexT 主题选项到 `/source/_data/next.yml` 中。 | ||
3. 然后,在站点的 `/_config.yml` 中需要定义 `theme: next` 选项(如果需要的话,`source_dir: source`)。 | ||
4. 使用标准参数来启动服务器,生成或部署(`hexo clean && hexo g -d && hexo s`)。 | ||
### 相关链接 | ||
* [NexT Issue #328](https://github.com/iissnan/hexo-theme-next/issues/328) | ||
* [Hexo 配置](https://hexo.io/zh-cn/docs/configuration.html) | ||
* [Hexo Pull #757](https://github.com/hexojs/hexo/pull/757) | ||
* [Hexo Pull #4120](https://github.com/hexojs/hexo/pull/4120) |
@@ -26,3 +26,3 @@ <h1 align="center">安装</h1> | ||
$ mkdir themes/next | ||
$ curl -s https://api.github.com/repos/hexo-next/hexo-theme-next/releases/latest | grep tarball_url | cut -d '"' -f 4 | wget -i - -O- | tar -zx -C themes/next --strip-components=1 | ||
$ curl -s https://api.github.com/repos/next-theme/hexo-theme-next/releases/latest | grep tarball_url | cut -d '"' -f 4 | wget -i - -O- | tar -zx -C themes/next --strip-components=1 | ||
``` | ||
@@ -42,3 +42,3 @@ 这种方式将**仅提供最新的 release 版本**(其中不附带 `.git` 目录)。\ | ||
$ mkdir themes/next | ||
$ curl -L https://api.github.com/repos/hexo-next/hexo-theme-next/tarball/v6.0.0 | tar -zxv -C themes/next --strip-components=1 | ||
$ curl -L https://api.github.com/repos/next-theme/hexo-theme-next/tarball/v6.0.0 | tar -zxv -C themes/next --strip-components=1 | ||
``` | ||
@@ -50,3 +50,3 @@ 和上述的 `curl、tar 和 wget` 方法相同,但只会下载**指定的 release 版本**。 | ||
```sh | ||
$ git clone --branch v6.0.0 https://github.com/hexo-next/hexo-theme-next themes/next | ||
$ git clone --branch v6.0.0 https://github.com/next-theme/hexo-theme-next themes/next | ||
``` | ||
@@ -64,3 +64,3 @@ 这一方式将为你下载**指定的 release 版本**(其中包含 `.git` 目录)。\ | ||
$ mkdir themes/next | ||
$ curl -L https://api.github.com/repos/hexo-next/hexo-theme-next/tarball | tar -zxv -C themes/next --strip-components=1 | ||
$ curl -L https://api.github.com/repos/next-theme/hexo-theme-next/tarball | tar -zxv -C themes/next --strip-components=1 | ||
``` | ||
@@ -73,3 +73,3 @@ 和上述的 `curl、tar 和 wget` 方法相同,但只会下载**最新 master 分支版本**。\ | ||
```sh | ||
$ git clone https://github.com/hexo-next/hexo-theme-next themes/next | ||
$ git clone https://github.com/next-theme/hexo-theme-next themes/next | ||
``` | ||
@@ -115,7 +115,7 @@ | ||
[download-latest-url]: https://github.com/hexo-next/hexo-theme-next/archive/master.zip | ||
[releases-latest-url]: https://github.com/hexo-next/hexo-theme-next/releases/latest | ||
[releases-url]: https://github.com/hexo-next/hexo-theme-next/releases | ||
[tags-url]: https://github.com/hexo-next/hexo-theme-next/tags | ||
[commits-url]: https://github.com/hexo-next/hexo-theme-next/commits/master | ||
[download-latest-url]: https://github.com/next-theme/hexo-theme-next/archive/master.zip | ||
[releases-latest-url]: https://github.com/next-theme/hexo-theme-next/releases/latest | ||
[releases-url]: https://github.com/next-theme/hexo-theme-next/releases | ||
[tags-url]: https://github.com/next-theme/hexo-theme-next/tags | ||
[commits-url]: https://github.com/next-theme/hexo-theme-next/commits/master | ||
@@ -126,3 +126,3 @@ [git-url]: http://lmgtfy.com/?q=linux+git+install | ||
[update-with-git-url]: https://github.com/hexo-next/hexo-theme-next/blob/master/docs/zh-CN/README.md#update | ||
[docs-data-files-url]: https://github.com/hexo-next/hexo-theme-next/blob/master/docs/zh-CN/DATA-FILES.md | ||
[update-with-git-url]: https://github.com/next-theme/hexo-theme-next/blob/master/docs/zh-CN/README.md#update | ||
[docs-data-files-url]: https://github.com/next-theme/hexo-theme-next/blob/master/docs/zh-CN/DATA-FILES.md |
@@ -53,3 +53,3 @@ <h1 align="center">修复 LeanCloud 统计插件安全漏洞</h1> | ||
server_url: # <your server url> | ||
# Dependencies: https://github.com/hexo-next/hexo-leancloud-counter-security | ||
# Dependencies: https://github.com/theme-next/hexo-leancloud-counter-security | ||
security: true | ||
@@ -113,3 +113,3 @@ ``` | ||
server_url: # <your server url> | ||
# Dependencies: https://github.com/hexo-next/hexo-leancloud-counter-security | ||
# Dependencies: https://github.com/theme-next/hexo-leancloud-counter-security | ||
security: true | ||
@@ -116,0 +116,0 @@ ``` |
@@ -158,8 +158,8 @@ <h1 align="center">数学公式</h1> | ||
2. 块级公式(例如 `$$...$$`)必须位于空行。\ | ||
即在开头的 `$$` 前和在结尾的 `$$` 后不能有除了空白字符以外的其他字符。([#32comment](https://github.com/hexo-next/hexo-theme-next/pull/32#issuecomment-357489509)) | ||
3. 不支持 Unicode。([#32comment](https://github.com/hexo-next/hexo-theme-next/pull/32#issuecomment-357489509)) | ||
4. 行内公式(例如 `$...$`)在开头的 `$` 后面和结尾的 `$` 前面**不能含有空格**。([#32comment](https://github.com/hexo-next/hexo-theme-next/pull/32#issuecomment-357489509)) | ||
即在开头的 `$$` 前和在结尾的 `$$` 后不能有除了空白字符以外的其他字符。([#32comment](https://github.com/theme-next/hexo-theme-next/pull/32#issuecomment-357489509)) | ||
3. 不支持 Unicode。([#32comment](https://github.com/theme-next/hexo-theme-next/pull/32#issuecomment-357489509)) | ||
4. 行内公式(例如 `$...$`)在开头的 `$` 后面和结尾的 `$` 前面**不能含有空格**。([#32comment](https://github.com/theme-next/hexo-theme-next/pull/32#issuecomment-357489509)) | ||
5. 如果你在文章的各级标题中(例如 `## 标题`)使用公式。\ | ||
那么文章目录中的这个标题会出现 3 次未渲染的公式代码([#32comment](https://github.com/hexo-next/hexo-theme-next/pull/32#issuecomment-359018694)) | ||
6. 如果你在文章 Title 中使用公式,那么公式将不会被渲染。([#32comment](https://github.com/hexo-next/hexo-theme-next/pull/32#issuecomment-359142879)) | ||
那么文章目录中的这个标题会出现 3 次未渲染的公式代码([#32comment](https://github.com/theme-next/hexo-theme-next/pull/32#issuecomment-359018694)) | ||
6. 如果你在文章 Title 中使用公式,那么公式将不会被渲染。([#32comment](https://github.com/theme-next/hexo-theme-next/pull/32#issuecomment-359142879)) | ||
@@ -166,0 +166,0 @@ 我们目前使用的 Katex 版本为 0.11.1,这里面可能有某些问题是因为 Katex 版本老旧导致的; |
@@ -8,3 +8,3 @@ <div align="right"> | ||
# <div align="center"><a title="NexT website repository" href="https://github.com/hexo-next/theme-next.org"><img align="center" width="56" height="56" src="https://raw.githubusercontent.com/hexo-next/hexo-theme-next/master/source/images/logo.svg?sanitize=true"></a> e x T</div> | ||
# <div align="center"><a title="NexT website repository" href="https://github.com/next-theme/theme-next.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> | ||
@@ -15,12 +15,8 @@ <p align="center"> | ||
<br> | ||
<a href="https://www.npmjs.com/package/hexo-theme-next"><img src="https://img.shields.io/github/package-json/v/hexo-next/hexo-theme-next?style=flat-square"></a> | ||
<a href="https://www.npmjs.com/package/hexo-theme-next"><img src="https://img.shields.io/npm/v/hexo-theme-next?style=flat-square"></a> | ||
<a href="https://nodejs.org"><img src="https://img.shields.io/badge/node-%3E=10.9.0-green?style=flat-square"></a> | ||
<a href="https://hexo.io"><img src="https://img.shields.io/badge/hexo-%3E=4.0.0-blue?style=flat-square&logo=hexo"></a> | ||
<a href="https://github.com/hexo-next/hexo-theme-next/blob/master/LICENSE.md"><img src="https://img.shields.io/badge/license-%20AGPL-orange?style=flat-square&logo=gnu"></a> | ||
<a href="https://github.com/next-theme/hexo-theme-next/blob/master/LICENSE.md"><img src="https://img.shields.io/badge/license-%20AGPL-orange?style=flat-square&logo=gnu"></a> | ||
<img src="https://img.shields.io/github/workflow/status/next-theme/hexo-theme-next/Linter?style=flat-square"> | ||
<br> | ||
<a href="https://bestpractices.coreinfrastructure.org/projects/2625"><img src="https://img.shields.io/cii/level/2625?style=flat-square" title="Core Infrastructure Initiative Best Practices"></a> | ||
<a href="https://travis-ci.org/hexo-next/hexo-theme-next?branch=master"><img src="https://img.shields.io/travis/hexo-next/hexo-theme-next/master?style=flat-square&logo=travis%20ci" title="Travis CI [Linux]"></a> | ||
<a href="https://app.codacy.com/manual/hexo-next/hexo-theme-next/dashboard"><img src="https://img.shields.io/codacy/grade/72f7fe7609c2438a92069f448e5a341a/master?style=flat-square&logo=codacy" title="Project Grade"></a> | ||
<img src="https://img.shields.io/snyk/vulnerabilities/github/hexo-next/hexo-theme-next?style=flat-square" title="Vulnerabilities"> | ||
<br> | ||
<img src="https://user-images.githubusercontent.com/16272760/63487983-da41b080-c4df-11e9-951c-64883a8a5e9b.png"> | ||
@@ -35,3 +31,3 @@ </p> | ||
<br> | ||
更多 «NexT» 的例子参见<a href="https://github.com/hexo-next/awesome-next#live-preview">这里</a>。 | ||
更多 «NexT» 的例子参见<a href="https://github.com/next-theme/awesome-next#live-preview">这里</a>。 | ||
</p> | ||
@@ -45,3 +41,3 @@ | ||
$ cd hexo | ||
$ git clone https://github.com/hexo-next/hexo-theme-next themes/next | ||
$ git clone https://github.com/next-theme/hexo-theme-next themes/next | ||
``` | ||
@@ -59,3 +55,3 @@ | ||
# Easily enable fast Ajax navigation on your website. | ||
# Dependencies: https://github.com/hexo-next/theme-next-pjax | ||
# Dependencies: https://github.com/next-theme/pjax | ||
pjax: true | ||
@@ -120,6 +116,4 @@ ``` | ||
<a href="https://github.com"><img align="center" width="100" src="https://github.githubassets.com/images/modules/logos_page/GitHub-Logo.png"></a> | ||
| ||
<a href="https://www.netlify.com"><img align="center" width="150" src="https://cdn.netlify.com/15ecf59b59c9d04b88097c6b5d2c7e8a7d1302d0/1b6d6/img/press/logos/full-logo-light.svg"></a> | ||
<br> | ||
<sub>GitHub 容许我们托管 Git 仓库,Netlify 容许我们分发文档。</sub> | ||
<sub>GitHub 容许我们托管 Git 仓库和发布文档。</sub> | ||
<br> | ||
@@ -130,16 +124,8 @@ <br> | ||
<sub>Crowdin 容许我们方便地翻译文档。</sub> | ||
<br> | ||
<br> | ||
<a href="https://codacy.com"><img align="center" width="155" src="https://user-images.githubusercontent.com/16944225/55026017-623f8f00-5002-11e9-88bf-0d6a5884c6c2.png"></a> | ||
| ||
<a href="https://travis-ci.com"><img align="center" width="140" src="https://raw.githubusercontent.com/travis-ci/travis-web/master/public/images/logos/TravisCI-Full-Color.png"></a> | ||
<br> | ||
<sub>Codacy 容许我们监控代码质量,Travis CI 容许我们运行测试套件。</sub> | ||
</p> | ||
[docs-installation-url]: https://github.com/hexo-next/hexo-theme-next/blob/master/docs/zh-CN/INSTALLATION.md | ||
[docs-data-files-url]: https://github.com/hexo-next/hexo-theme-next/blob/master/docs/zh-CN/DATA-FILES.md | ||
[docs-update-5-1-x-url]: https://github.com/hexo-next/hexo-theme-next/blob/master/docs/zh-CN/UPDATE-FROM-5.1.X.md | ||
[docs-installation-url]: https://github.com/next-theme/hexo-theme-next/blob/master/docs/zh-CN/INSTALLATION.md | ||
[docs-data-files-url]: https://github.com/next-theme/hexo-theme-next/blob/master/docs/zh-CN/DATA-FILES.md | ||
[docs-update-5-1-x-url]: https://github.com/next-theme/hexo-theme-next/blob/master/docs/zh-CN/UPDATE-FROM-5.1.X.md | ||
[t-news-url]: https://t.me/theme_next_news | ||
[t-chat-url]: https://t.me/theme_next_chinese | ||
@@ -150,10 +136,10 @@ [gitter-url]: https://gitter.im/theme-next | ||
[awesome-next-url]: https://github.com/hexo-next/awesome-next | ||
[issues-bug-url]: https://github.com/hexo-next/hexo-theme-next/issues/new?assignees=&labels=Bug&template=bug-report.md | ||
[issues-feat-url]: https://github.com/hexo-next/hexo-theme-next/issues/new?assignees=&labels=Feature+Request&template=feature-request.md | ||
[feat-req-vote-url]: https://github.com/hexo-next/hexo-theme-next/issues?q=is%3Aopen+is%3Aissue+label%3A%22Feature+Request%22 | ||
[awesome-next-url]: https://github.com/next-theme/awesome-next | ||
[issues-bug-url]: https://github.com/next-theme/hexo-theme-next/issues/new?assignees=&labels=Bug&template=bug-report.md | ||
[issues-feat-url]: https://github.com/next-theme/hexo-theme-next/issues/new?assignees=&labels=Feature+Request&template=feature-request.md | ||
[feat-req-vote-url]: https://github.com/next-theme/hexo-theme-next/issues?q=is%3Aopen+is%3Aissue+label%3A%22Feature+Request%22 | ||
[contributing-document-url]: https://github.com/hexo-next/hexo-theme-next/blob/master/docs/zh-CN/CONTRIBUTING.md | ||
[contributing-document-url]: https://github.com/next-theme/hexo-theme-next/blob/master/docs/zh-CN/CONTRIBUTING.md | ||
[official-plugins-url]: https://github.com/theme-next | ||
[contributors-image]: https://opencollective.com/hexo-next/contributors.svg?width=890 | ||
[contributors-url]: https://github.com/hexo-next/hexo-theme-next/graphs/contributors | ||
[contributors-image]: https://opencollective.com/next-theme/contributors.svg?width=890 | ||
[contributors-url]: https://github.com/next-theme/hexo-theme-next/graphs/contributors |
<h1 align="center">从 NexT v5.1.x 更新</h1> | ||
在使用 Hexo 3 时,NexT V5 版本仍然能够正常运行,但是如果你想获得更多的功能和帮助,还是建议您升级到 NexT V7+ 版本,并移步 [Theme-Next](https://github.com/hexo-next/hexo-theme-next) 仓库。 | ||
在使用 Hexo 3 时,NexT V5 版本仍然能够正常运行,但是如果你想获得更多的功能和帮助,还是建议您升级到 NexT V7+ 版本,并移步 [Theme-Next](https://github.com/next-theme/hexo-theme-next) 仓库。 | ||
@@ -9,3 +9,3 @@ 在 5.1.x 版本和新版本之间没有很大的革命性改进。主版本号变更至 7 主要是因为: | ||
2. `next/source/lib` 目录下的绝大多数库被移出到了 [NexT 组织的外部仓库](https://github.com/theme-next)中。 | ||
3. 第三方插件 [`hexo-wordcount`](https://github.com/willin/hexo-wordcount) 被 [`hexo-symbols-count-time`](https://github.com/hexo-next/hexo-symbols-count-time) 所取代,因为 `hexo-symbols-count-time` 没有任何外部 Node.js 依赖、也没有会导致生成站点时的性能问题 [language filter](https://github.com/willin/hexo-wordcount/issues/7)。 | ||
3. 第三方插件 [`hexo-wordcount`](https://github.com/willin/hexo-wordcount) 被 [`hexo-symbols-count-time`](https://github.com/next-theme/hexo-symbols-count-time) 所取代,因为 `hexo-symbols-count-time` 没有任何外部 Node.js 依赖、也没有会导致生成站点时的性能问题 [language filter](https://github.com/willin/hexo-wordcount/issues/7)。 | ||
@@ -21,3 +21,3 @@ 我们推荐通过如下步骤从 v5 升级到 v7: | ||
```sh | ||
$ git clone https://github.com/hexo-next/hexo-theme-next themes/next-reloaded | ||
$ git clone https://github.com/next-theme/hexo-theme-next themes/next-reloaded | ||
``` | ||
@@ -35,3 +35,3 @@ 如此,你可以在不修改原有的 NexT v5.1.x 目录的同时使用 `next-reloaded` 目录中的新版本主题。 | ||
从 v6.0.3 版本起,`zh-Hans` 改名为 `zh-CN`:https://github.com/hexo-next/hexo-theme-next/releases/tag/v6.0.3 | ||
从 v6.0.3 版本起,`zh-Hans` 改名为 `zh-CN`:https://github.com/next-theme/hexo-theme-next/releases/tag/v6.0.3 | ||
@@ -43,2 +43,2 @@ 升级到 v6.0.3 及以后版本的用户,需要显式修改 Hexo 主配置文件 `_config.yml` 里的 `language` 配置,否则语言显示不正确。 | ||
关于第三方库的启用,参见[这里](https://github.com/hexo-next/hexo-theme-next/blob/master/docs/zh-CN/INSTALLATION.md#插件)。 | ||
关于第三方库的启用,参见[这里](https://github.com/next-theme/hexo-theme-next/blob/master/docs/zh-CN/INSTALLATION.md#插件)。 |
const fs = require('fs'); | ||
const path = require('path'); | ||
const gulp = require('gulp'); | ||
const eslint = require('gulp-eslint'); | ||
const shell = require('gulp-shell'); | ||
const yaml = require('js-yaml'); | ||
gulp.task('lint', () => gulp.src([ | ||
'./source/js/**/*.js', | ||
'./scripts/**/*.js' | ||
]).pipe(eslint()) | ||
.pipe(eslint.format())); | ||
gulp.task('lint', shell.task([ | ||
'npm run eslint' | ||
])); | ||
gulp.task('lint:stylus', shell.task([ | ||
'npx stylint ./source/css/' | ||
'npm run stylint' | ||
])); | ||
@@ -17,0 +14,0 @@ |
# <div align="center">«NexT» – Elegant and powerful theme for Hexo.</div> | ||
<p align="center">Copyright © 2017 «<a href="https://github.com/hexo-next/hexo-theme-next">NexT</a>».</p> | ||
<p align="center">Copyright © 2017 «<a href="https://github.com/next-theme/hexo-theme-next">NexT</a>».</p> | ||
@@ -5,0 +5,0 @@ <p align="center">Detail attribution information for «NexT»<br> |
{ | ||
"name": "hexo-theme-next", | ||
"version": "8.0.0-rc.1", | ||
"version": "8.0.0-rc.2", | ||
"description": "Elegant and powerful theme for Hexo.", | ||
"main": "gulpfile.js", | ||
"scripts": { | ||
"test": "gulp" | ||
"test": "gulp", | ||
"eslint": "eslint source/js scripts/", | ||
"stylint": "stylint source/css/" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/hexo-next/hexo-theme-next.git" | ||
"url": "git+https://github.com/next-theme/hexo-theme-next.git" | ||
}, | ||
@@ -21,13 +23,12 @@ "keywords": [ | ||
"bugs": { | ||
"url": "https://github.com/hexo-next/hexo-theme-next/issues" | ||
"url": "https://github.com/next-theme/hexo-theme-next/issues" | ||
}, | ||
"homepage": "https://theme-next.org", | ||
"devDependencies": { | ||
"eslint": "^6.8.0", | ||
"eslint-config-theme-next": "^1.1.4", | ||
"gulp": "^4.0.2", | ||
"gulp-eslint": "^6.0.0", | ||
"gulp-shell": "^0.8.0", | ||
"js-yaml": "^3.13.1", | ||
"stylint": "^2.0.0" | ||
"eslint": "7.0.0", | ||
"eslint-config-theme-next": "1.1.4", | ||
"gulp": "4.0.2", | ||
"gulp-shell": "0.8.0", | ||
"js-yaml": "3.13.1", | ||
"stylint": "2.0.0" | ||
}, | ||
@@ -34,0 +35,0 @@ "engines": { |
@@ -8,3 +8,3 @@ <div align="right"> | ||
# <div align="center"><a title="NexT website repository" href="https://github.com/hexo-next/theme-next.org"><img align="center" width="56" height="56" src="https://raw.githubusercontent.com/hexo-next/hexo-theme-next/master/source/images/logo.svg?sanitize=true"></a> e x T</div> | ||
# <div align="center"><a title="NexT website repository" href="https://github.com/next-theme/theme-next.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> | ||
@@ -15,12 +15,8 @@ <p align="center"> | ||
<br> | ||
<a href="https://www.npmjs.com/package/hexo-theme-next"><img src="https://img.shields.io/github/package-json/v/hexo-next/hexo-theme-next?style=flat-square"></a> | ||
<a href="https://www.npmjs.com/package/hexo-theme-next"><img src="https://img.shields.io/npm/v/hexo-theme-next?style=flat-square"></a> | ||
<a href="https://nodejs.org"><img src="https://img.shields.io/badge/node-%3E=10.9.0-green?style=flat-square"></a> | ||
<a href="https://hexo.io"><img src="https://img.shields.io/badge/hexo-%3E=4.0.0-blue?style=flat-square&logo=hexo"></a> | ||
<a href="https://github.com/hexo-next/hexo-theme-next/blob/master/LICENSE.md"><img src="https://img.shields.io/badge/license-%20AGPL-orange?style=flat-square&logo=gnu"></a> | ||
<a href="https://github.com/next-theme/hexo-theme-next/blob/master/LICENSE.md"><img src="https://img.shields.io/badge/license-%20AGPL-orange?style=flat-square&logo=gnu"></a> | ||
<img src="https://img.shields.io/github/workflow/status/next-theme/hexo-theme-next/Linter?style=flat-square"> | ||
<br> | ||
<a href="https://bestpractices.coreinfrastructure.org/projects/2625"><img src="https://img.shields.io/cii/level/2625?style=flat-square" title="Core Infrastructure Initiative Best Practices"></a> | ||
<a href="https://travis-ci.org/hexo-next/hexo-theme-next?branch=master"><img src="https://img.shields.io/travis/hexo-next/hexo-theme-next/master?style=flat-square&logo=travis%20ci" title="Travis CI [Linux]"></a> | ||
<a href="https://app.codacy.com/manual/hexo-next/hexo-theme-next/dashboard"><img src="https://img.shields.io/codacy/grade/72f7fe7609c2438a92069f448e5a341a/master?style=flat-square&logo=codacy" title="Project Grade"></a> | ||
<img src="https://img.shields.io/snyk/vulnerabilities/github/hexo-next/hexo-theme-next?style=flat-square" title="Vulnerabilities"> | ||
<br> | ||
<img src="https://user-images.githubusercontent.com/16272760/63487983-da41b080-c4df-11e9-951c-64883a8a5e9b.png"> | ||
@@ -35,3 +31,3 @@ </p> | ||
<br> | ||
More «NexT» examples <a href="https://github.com/hexo-next/awesome-next#live-preview">here</a>. | ||
More «NexT» examples <a href="https://github.com/next-theme/awesome-next#live-preview">here</a>. | ||
</p> | ||
@@ -45,3 +41,3 @@ | ||
$ cd hexo | ||
$ git clone https://github.com/hexo-next/hexo-theme-next themes/next | ||
$ git clone https://github.com/next-theme/hexo-theme-next themes/next | ||
``` | ||
@@ -59,3 +55,3 @@ | ||
# Easily enable fast Ajax navigation on your website. | ||
# Dependencies: https://github.com/hexo-next/theme-next-pjax | ||
# Dependencies: https://github.com/next-theme/pjax | ||
pjax: true | ||
@@ -120,7 +116,5 @@ ``` | ||
<a href="https://github.com"><img align="center" width="100" src="https://github.githubassets.com/images/modules/logos_page/GitHub-Logo.png"></a> | ||
| ||
<a href="https://www.netlify.com"><img align="center" width="150" src="https://cdn.netlify.com/15ecf59b59c9d04b88097c6b5d2c7e8a7d1302d0/1b6d6/img/press/logos/full-logo-light.svg"></a> | ||
<br> | ||
<br> | ||
<sub>GitHub allows us to host the Git repository, Netlify allows us to distribute the documentation.</sub> | ||
<sub>GitHub allows us to host the Git repository and distribute the documentation.</sub> | ||
<br> | ||
@@ -132,17 +126,8 @@ <br> | ||
<sub>Crowdin allows us to translate conveniently the documentation.</sub> | ||
<br> | ||
<br> | ||
<a href="https://codacy.com"><img align="center" width="155" src="https://user-images.githubusercontent.com/16944225/55026017-623f8f00-5002-11e9-88bf-0d6a5884c6c2.png"></a> | ||
| ||
<a href="https://travis-ci.com"><img align="center" width="140" src="https://raw.githubusercontent.com/travis-ci/travis-web/master/public/images/logos/TravisCI-Full-Color.png"></a> | ||
<br> | ||
<br> | ||
<sub>Codacy allows us to monitor code quality, Travis CI allows us to run the test suite.</sub> | ||
</p> | ||
[docs-installation-url]: https://github.com/hexo-next/hexo-theme-next/blob/master/docs/INSTALLATION.md | ||
[docs-data-files-url]: https://github.com/hexo-next/hexo-theme-next/blob/master/docs/DATA-FILES.md | ||
[docs-update-5-1-x-url]: https://github.com/hexo-next/hexo-theme-next/blob/master/docs/UPDATE-FROM-5.1.X.md | ||
[docs-installation-url]: https://github.com/next-theme/hexo-theme-next/blob/master/docs/INSTALLATION.md | ||
[docs-data-files-url]: https://github.com/next-theme/hexo-theme-next/blob/master/docs/DATA-FILES.md | ||
[docs-update-5-1-x-url]: https://github.com/next-theme/hexo-theme-next/blob/master/docs/UPDATE-FROM-5.1.X.md | ||
[t-news-url]: https://t.me/theme_next_news | ||
[t-chat-url]: https://t.me/theme_next | ||
@@ -153,10 +138,10 @@ [gitter-url]: https://gitter.im/theme-next | ||
[awesome-next-url]: https://github.com/hexo-next/awesome-next | ||
[issues-bug-url]: https://github.com/hexo-next/hexo-theme-next/issues/new?assignees=&labels=Bug&template=bug-report.md | ||
[issues-feat-url]: https://github.com/hexo-next/hexo-theme-next/issues/new?assignees=&labels=Feature+Request&template=feature-request.md | ||
[feat-req-vote-url]: https://github.com/hexo-next/hexo-theme-next/issues?q=is%3Aopen+is%3Aissue+label%3A%22Feature+Request%22 | ||
[awesome-next-url]: https://github.com/next-theme/awesome-next | ||
[issues-bug-url]: https://github.com/next-theme/hexo-theme-next/issues/new?assignees=&labels=Bug&template=bug-report.md | ||
[issues-feat-url]: https://github.com/next-theme/hexo-theme-next/issues/new?assignees=&labels=Feature+Request&template=feature-request.md | ||
[feat-req-vote-url]: https://github.com/next-theme/hexo-theme-next/issues?q=is%3Aopen+is%3Aissue+label%3A%22Feature+Request%22 | ||
[contributing-document-url]: https://github.com/hexo-next/hexo-theme-next/blob/master/.github/CONTRIBUTING.md | ||
[contributing-document-url]: https://github.com/next-theme/hexo-theme-next/blob/master/.github/CONTRIBUTING.md | ||
[official-plugins-url]: https://github.com/theme-next | ||
[contributors-image]: https://opencollective.com/hexo-next/contributors.svg?width=890 | ||
[contributors-url]: https://github.com/hexo-next/hexo-theme-next/graphs/contributors | ||
[contributors-image]: https://opencollective.com/next-theme/contributors.svg?width=890 | ||
[contributors-url]: https://github.com/next-theme/hexo-theme-next/graphs/contributors |
@@ -10,5 +10,7 @@ /* global hexo */ | ||
require('./lib/injects')(hexo); | ||
// Highlight | ||
require('./lib/highlight')(hexo); | ||
}); | ||
hexo.on('generateAfter', () => { | ||
hexo.on('exit', () => { | ||
if (!hexo.theme.config.reminder) return; | ||
@@ -18,3 +20,3 @@ const https = require('https'); | ||
const { version } = require(path.normalize('../../package.json')); | ||
https.get('https://api.github.com/repos/hexo-next/hexo-theme-next/releases/latest', { | ||
https.get('https://registry.npmjs.org/hexo-theme-next/latest', { | ||
headers: { | ||
@@ -30,14 +32,6 @@ 'User-Agent': 'Theme NexT Client' | ||
try { | ||
let latest = JSON.parse(result).tag_name.replace('v', '').split('.'); | ||
let current = version.split('.'); | ||
let isOutdated = false; | ||
for (let i = 0; i < Math.max(latest.length, current.length); i++) { | ||
if (!current[i] || latest[i] > current[i]) { | ||
isOutdated = true; | ||
break; | ||
} | ||
} | ||
if (isOutdated) { | ||
hexo.log.warn(`Your theme NexT is outdated. Current version: v${current.join('.')}, latest version: v${latest.join('.')}`); | ||
hexo.log.warn('Visit https://github.com/hexo-next/hexo-theme-next/releases for more information.'); | ||
const latest = JSON.parse(result).version; | ||
if (latest !== version) { | ||
hexo.log.warn(`Your theme NexT is outdated. Current version: v${version}, latest version: v${latest}`); | ||
hexo.log.warn('Visit https://github.com/next-theme/hexo-theme-next/releases for more information.'); | ||
} else { | ||
@@ -44,0 +38,0 @@ hexo.log.info('Congratulations! Your are using the latest version of theme NexT.'); |
@@ -21,17 +21,4 @@ 'use strict'; | ||
/** | ||
* Merge configs from _data/next.yml into hexo.theme.config. | ||
* If `override`, configs in next.yml will rewrite configs in hexo.theme.config. | ||
* If next.yml not exists, merge all `theme_config.*` into hexo.theme.config. | ||
*/ | ||
if (data.next) { | ||
if (data.next.override) { | ||
hexo.theme.config = data.next; | ||
} else { | ||
merge(hexo.config, data.next); | ||
merge(hexo.theme.config, data.next); | ||
} | ||
} else { | ||
merge(hexo.theme.config, hexo.config.theme_config); | ||
} | ||
// Merge all `theme_config.*` into hexo.theme.config. | ||
merge(hexo.theme.config, hexo.config.theme_config); | ||
@@ -38,0 +25,0 @@ if (hexo.theme.config.cache && hexo.theme.config.cache.enable && hexo.config.relative_link) { |
@@ -11,3 +11,3 @@ /* global hexo */ | ||
let theme = hexo.theme.config; | ||
if (!theme.valine.enable || !theme.valine.appid || !theme.valine.appkey) return; | ||
if (!theme.valine.enable || !theme.valine.appId || !theme.valine.appKey) return; | ||
@@ -23,3 +23,3 @@ injects.comment.raw('valine', '<div class="comments" id="valine-comments"></div>', {}, {cache: true}); | ||
let theme = hexo.theme.config; | ||
if (!theme.valine.enable || !theme.valine.appid || !theme.valine.appkey) return; | ||
if (!theme.valine.enable || !theme.valine.appId || !theme.valine.appKey) return; | ||
@@ -26,0 +26,0 @@ injects.postMeta.raw('valine', ` |
@@ -19,3 +19,3 @@ /** | ||
hexo.log.warn(`front-matter: '${variable}' has deprecated, source: ${source}`); | ||
hexo.log.warn('see: https://github.com/hexo-next/hexo-theme-next/pull/1211'); | ||
hexo.log.warn('see: https://github.com/theme-next/hexo-theme-next/pull/1211'); | ||
} | ||
@@ -22,0 +22,0 @@ |
/* global instantsearch, algoliasearch, CONFIG */ | ||
window.addEventListener('DOMContentLoaded', () => { | ||
document.addEventListener('DOMContentLoaded', () => { | ||
const algoliaSettings = CONFIG.algolia; | ||
@@ -118,3 +118,3 @@ const { indexName, appID, apiKey } = algoliaSettings; | ||
document.querySelector('.popup-btn-close').addEventListener('click', onPopupClose); | ||
window.addEventListener('pjax:success', onPopupClose); | ||
document.addEventListener('pjax:success', onPopupClose); | ||
window.addEventListener('keyup', event => { | ||
@@ -121,0 +121,0 @@ if (event.key === 'Escape') { |
/* global CONFIG */ | ||
window.addEventListener('DOMContentLoaded', () => { | ||
document.addEventListener('DOMContentLoaded', () => { | ||
'use strict'; | ||
@@ -34,3 +34,3 @@ | ||
window.addEventListener('beforeunload', doSaveScroll); | ||
window.addEventListener('pjax:send', doSaveScroll); | ||
document.addEventListener('pjax:send', doSaveScroll); | ||
} | ||
@@ -53,3 +53,3 @@ // Save the position by clicking the icon | ||
scrollToMark(); | ||
window.addEventListener('pjax:success', scrollToMark); | ||
document.addEventListener('pjax:success', scrollToMark); | ||
}; | ||
@@ -56,0 +56,0 @@ |
/* global CONFIG */ | ||
window.addEventListener('DOMContentLoaded', () => { | ||
document.addEventListener('DOMContentLoaded', () => { | ||
// Popup Window | ||
@@ -272,3 +272,3 @@ let isfetched = false; | ||
document.querySelector('.popup-btn-close').addEventListener('click', onPopupClose); | ||
window.addEventListener('pjax:success', onPopupClose); | ||
document.addEventListener('pjax:success', onPopupClose); | ||
window.addEventListener('keyup', event => { | ||
@@ -275,0 +275,0 @@ if (event.key === 'Escape') { |
@@ -14,2 +14,3 @@ /* global NexT, CONFIG, Velocity */ | ||
var siteNav = document.querySelector('.site-nav'); | ||
if (!siteNav) return; | ||
var animateAction = siteNav.classList.contains('site-nav-on') ? 'slideUp' : 'slideDown'; | ||
@@ -111,3 +112,3 @@ | ||
window.addEventListener('DOMContentLoaded', () => { | ||
document.addEventListener('DOMContentLoaded', () => { | ||
NexT.boot.registerEvents(); | ||
@@ -114,0 +115,0 @@ NexT.boot.refresh(); |
/* global NexT, CONFIG, Velocity */ | ||
window.addEventListener('DOMContentLoaded', () => { | ||
document.addEventListener('DOMContentLoaded', () => { | ||
@@ -5,0 +5,0 @@ var isRight = CONFIG.sidebar.position === 'right'; |
@@ -83,5 +83,5 @@ /* global NexT, CONFIG */ | ||
window.addEventListener('DOMContentLoaded', () => { | ||
document.addEventListener('DOMContentLoaded', () => { | ||
Affix.init(document.querySelector('.sidebar-inner'), NexT.utils.getAffixParam()); | ||
}); |
@@ -67,11 +67,14 @@ /* global NexT, CONFIG */ | ||
document.querySelectorAll('figure.highlight').forEach(element => { | ||
const box = document.createElement('div'); | ||
element.wrap(box); | ||
box.classList.add('highlight-container'); | ||
box.insertAdjacentHTML('beforeend', '<div class="copy-btn"><i class="fa fa-clipboard fa-fw"></i></div>'); | ||
var button = element.parentNode.querySelector('.copy-btn'); | ||
element.querySelectorAll('.code .line span').forEach(span => { | ||
span.classList.forEach(name => { | ||
span.classList.remove(name); | ||
span.classList.add(`hljs-${name}`); | ||
}); | ||
}); | ||
element.insertAdjacentHTML('beforeend', '<div class="copy-btn"><i class="fa fa-clipboard fa-fw"></i></div>'); | ||
const button = element.querySelector('.copy-btn'); | ||
button.addEventListener('click', event => { | ||
var target = event.currentTarget; | ||
var code = [...target.parentNode.querySelectorAll('.code .line')].map(line => line.innerText).join('\n'); | ||
var ta = document.createElement('textarea'); | ||
const target = event.currentTarget; | ||
const code = [...target.parentNode.querySelectorAll('.code .line')].map(line => line.innerText).join('\n'); | ||
const ta = document.createElement('textarea'); | ||
ta.style.top = window.scrollY + 'px'; // Prevent page scrolling | ||
@@ -88,3 +91,3 @@ ta.style.position = 'absolute'; | ||
ta.readOnly = false; | ||
var result = document.execCommand('copy'); | ||
const result = document.execCommand('copy'); | ||
if (CONFIG.copycode.show_result) { | ||
@@ -91,0 +94,0 @@ target.querySelector('i').className = result ? 'fa fa-check fa-fw' : 'fa fa-times fa-fw'; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
6
296
2504
919766
140
5