hexo-theme-next
Advanced tools
Comparing version 6.2.0 to 6.3.0
{ | ||
"name": "theme-next", | ||
"version": "6.2.0", | ||
"version": "6.3.0", | ||
"homepage": "https://theme-next.org", | ||
"authors": [ | ||
"iissnan <iissnan@gmail.com>", | ||
"Ivan Nginx <ivan.nginx@gmail.com> (https://almostover.ru)" | ||
"NexT <support@theme-next.org> (https://theme-next.org)" | ||
], | ||
@@ -14,3 +13,3 @@ "description": "Elegant theme for Hexo", | ||
"theme", | ||
"NexT" | ||
"next" | ||
], | ||
@@ -17,0 +16,0 @@ "license": "AGPL", |
@@ -154,3 +154,3 @@ Before you make the config, please upgrade your NexT version to v6.0.6 or greater. | ||
- Click `1`(add_fields), then choose `2`: | ||
- <del>Click `1`(add_fields), then choose `2`:</del>Do as below "create" setting(choose the user you create): | ||
@@ -157,0 +157,0 @@ ![18](https://lc-cqha0xyi.cn-n1.lcfile.com/14a8cb37062693d768ad.jpg) |
<h1 align="center">Math Equations</h1> | ||
NexT provides render engine for displaying Math Equations. | ||
NexT provides two render engines for displaying Math Equations. | ||
With using this feature, you don't need to manually import any JS or CSS. Just need to turn on `enable` of `math` and choose a render `engine` for it (located in `next/_config.yml`): | ||
If you choose to use this feature, you don't need to manually import any JS or CSS. You just need to turn on `enable` of `math` and choose a render `engine` for it (located in `next/_config.yml`): | ||
@@ -14,4 +14,3 @@ ```yml | ||
Notice: only turn on `enable` of `math` **cannot let you see the displayed equations correctly**, you need to install **corresponding Hexo Renderer** to fully support display the Math Equations. | ||
The corresponding Hexo Renderer per engine will provide below. | ||
Notice: only turning on `enable` of `math` **cannot let you see the displayed equations correctly**, you need to install the **corresponding Hexo Renderer** to fully support the display of Math Equations. The corresponding Hexo Renderer per engine will be provided below. | ||
@@ -26,3 +25,3 @@ <h2 align="center">Provided Render Engine</h2> | ||
Firstly, you need to uninstall the original renderer `hexo-renderer-marked`, and install one of them above: | ||
Firstly, you need to uninstall the original renderer `hexo-renderer-marked`, and install one of the renderer above: | ||
@@ -44,3 +43,3 @@ ```sh | ||
Finally, run standart Hexo generate, deploy process or start the server: | ||
Finally, run standard Hexo generate, deploy process or start the server: | ||
@@ -52,2 +51,62 @@ ```sh | ||
#### Numbering and referring equations in MathJax | ||
In the new version of NexT, we have added feature to automatically number equations and to refer to equations. We briefly describe how to use this feature below. | ||
In general, to make the automatic equation numbering work, you have to wrap your LaTeX equations in `equation` environment. Using the plain old style (i.e., wrap an equation with two dollar signs in each side) will not work. How to refer to an equation? Just give a `\label{}` tag and then in your later text, use `\ref{}` or `\eqref{}` to refer it. Using `\eqref{}` is preferred since if you use `\ref{}`, there are no parentheses around the equation number. Below are some of the common scenarios for equation numbering. | ||
For simple equations, use the following form to give a tag, | ||
```latex | ||
$$\begin{equation} | ||
e=mc^2 | ||
\end{equation}\label{eq1}$$ | ||
``` | ||
Then, you can refer to this equation in your text easily by using something like | ||
``` | ||
the famous matter-energy equation $\eqref{eq1}$ proposed by Einstein ... | ||
``` | ||
For multi-line equations, inside the `equation` environment, you can use the `aligned` environment to split it into multiple lines: | ||
```latex | ||
$$\begin{equation} | ||
\begin{aligned} | ||
a &= b + c \\ | ||
&= d + e + f + g \\ | ||
&= h + i | ||
\end{aligned} | ||
\end{equation}\label{eq2}$$ | ||
``` | ||
We can use `align` environment to align multiple equations. Each of these equations will get its own numbers. | ||
``` | ||
$$\begin{align} | ||
a &= b + c \label{eq3} \\ | ||
x &= yz \label{eq4}\\ | ||
l &= m - n \label{eq5} | ||
\end{align}$$ | ||
``` | ||
In the `align` environment, if you do not want to number one or some equations, just [use `\nonumber`](https://tex.stackexchange.com/questions/17528/show-equation-number-only-once-in-align-environment) right behind these equations. Like the following: | ||
```latex | ||
$$\begin{align} | ||
-4 + 5x &= 2+y \nonumber \\ | ||
w+2 &= -1+w \\ | ||
ab &= cb | ||
\end{align}$$ | ||
``` | ||
Sometimes, you want to use more “exotic” style to refer your equation. You can use `\tag{}` to achieve this. For example: | ||
```latex | ||
$$x+1\over\sqrt{1-x^2} \tag{i}\label{eq_tag}$$ | ||
``` | ||
For more information, you can visit the [official MathJax documentation on equation numbering](http://docs.mathjax.org/en/latest/tex.html#automatic-equation-numbering). You can also visit this [post](https://jdhao.github.io/2018/01/25/hexo-mathjax-equation-number/) for more details. | ||
### Katex | ||
@@ -57,3 +116,3 @@ | ||
But, what Katex supports is not as full as the MathJax does. You could check it from the Useful Links below. | ||
But, what Katex supports is not as full as MathJax. You could check it from the Useful Links below. | ||
@@ -80,3 +139,3 @@ If you use Katex to render Math Equations, you need to use **only one of those renderer**: [hexo-renderer-markdown-it-plus](https://github.com/CHENXCHEN/hexo-renderer-markdown-it-plus) or [hexo-renderer-markdown-it](https://github.com/hexojs/hexo-renderer-markdown-it). | ||
Finally, run the standart Hexo generate, deploy process or start the server: | ||
Finally, run the standard Hexo generate, deploy process or start the server: | ||
@@ -118,3 +177,3 @@ ```sh | ||
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 whitespaces **after the opening `$` and before the ending `$`** ([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`).\ | ||
@@ -124,5 +183,5 @@ 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)). | ||
We currently use Katex 0.7.1, some of those bugs might cause by the outdated version of Katex we used. | ||
We currently use Katex 0.7.1, some of those bugs might be caused by the outdated version of Katex we use. | ||
But, as described in beginning, the render of Math Equations relies on Hexo Renderer. Currently, Katex related renderer only support until 0.7.1. | ||
But, as what is described in the beginning, the render of Math Equations relies on Hexo Renderer. Currently, Katex-related renderers only support Katex version until 0.7.1. | ||
@@ -133,3 +192,3 @@ We will continuously monitor the updates of corresponding renderers, if there is a renderer which supports newer version of Katex, we will update the Katex we use. | ||
* [Speedtest between Katex and MathJax](https://www.intmath.com/cg5/katex-mathjax-comparison.php) | ||
* [Speed test between Katex and MathJax](https://www.intmath.com/cg5/katex-mathjax-comparison.php) | ||
* [Function support by Katex](https://khan.github.io/KaTeX/function-support.html) | ||
@@ -143,3 +202,3 @@ | ||
If your content of config just directly after the config name, then a space is needed between the colon and the config content (i.e. `enable: true`) | ||
If your content of config is put just directly after the config name, then a space is needed between the colon and the config content (i.e. `enable: true`) | ||
@@ -183,3 +242,3 @@ ```yml | ||
`true` to turn on render of Math Equations, `false` to off it. | ||
`true` to turn on render of Math Equations, `false` to turn off it. | ||
@@ -230,14 +289,14 @@ ### per_page | ||
Firstly, both MathJax and Katex use the [jsDelivr](https://www.jsdelivr.com/) as default CDN. | ||
Firstly, both MathJax and Katex use the [jsDelivr](https://www.jsdelivr.com/) as the default CDN. | ||
Why choose the jsDelivr is because it is fast in everywhere, and jsDelivr has the valid ICP license issued by the Chinese government, it can be accessed in China pretty well. | ||
The reason that jsDelivr is chosen is because it is fast everywhere, and jsDelivr has the valid ICP license issued by the Chinese government, it can be accessed in China pretty well. | ||
And we also provide other optional CDNs, including the famous [CDNJS](https://cdnjs.com/) and the [Bootcss](http://www.bootcdn.cn/) which has the quite high access speed in China. | ||
For MathJax, we are currently using the 2.7.1 version. | ||
For MathJax, we are currently using version 2.7.1. | ||
For Katex, due to the problem described above, we are now using the 0.7.1 version. | ||
For Katex, due to the problem described above, we are now using version 0.7.1. | ||
If you want to try the other CDN not included in the optional list, you must use the corresponding version. | ||
If you want to try the other CDNs not included in the optional list, you must use the corresponding version. | ||
Particularly, if you are Chinese blogger or most of your visits are come from China, please note that **the CDNJS is blocked in some parts of China**, don't use it as CDN. | ||
Particularly, if you are a Chinese blogger or most of your visits come from China, please note that **the CDNJS is blocked in some parts of China**, don't use it as your CDN. |
@@ -88,13 +88,13 @@ <div align="right">Язык: <a title="Английский" href="../../README.md">:us:</a> | ||
[gitter-image]: https://badges.gitter.im/Join%20Chat.svg | ||
[gitter-image]: https://img.shields.io/badge/gitter-chat-orange.svg "Вступить в нашу комнату Gitter'а" | ||
[gitter-url]: https://gitter.im/theme-next | ||
[riot-image]: https://img.shields.io/badge/riot-join%20chat-green.svg | ||
[riot-image]: https://img.shields.io/badge/riot-chat-DCAB08.svg "Вступить в нашу комнату Riot'а" | ||
[riot-url]: https://riot.im/app/#/room/#NexT:matrix.org | ||
[t-chat-image]: https://img.shields.io/badge/telegram-chat-lightgrey.svg | ||
[t-chat-url]: https://t.me/joinchat/GUNHXA-vZkgSMuimL1VmMw | ||
[t-chat-image]: https://img.shields.io/badge/telegram-chat-BAB210.svg "Вступить в нашу группу Telegram'а" | ||
[t-chat-url]: https://t.me/theme_next | ||
[t-news-image]: https://img.shields.io/badge/telegram-news-lightgrey.svg | ||
[t-news-url]: https://t.me/theme_next | ||
[t-news-image]: https://img.shields.io/badge/telegram-news-98B919.svg "Подписаться на канал Telegram'а с новостями" | ||
[t-news-url]: https://t.me/theme_next_news | ||
@@ -101,0 +101,0 @@ [travis-image]: https://travis-ci.org/theme-next/hexo-theme-next.svg?branch=master |
@@ -161,3 +161,3 @@ 在配置前,请升级NexT至**v6.0.6**以上。 | ||
- 点击`1`add_fields后选择`2`指定用户, 并将下两栏留空: | ||
- <del>点击`1`add_fields后选择`2`指定用户, 并将下两栏留空:</del>此处应与下条create设置相同(选择你所创建的用户): | ||
@@ -164,0 +164,0 @@ ![18](https://lc-cqha0xyi.cn-n1.lcfile.com/14a8cb37062693d768ad.jpg) |
@@ -50,2 +50,63 @@ <h1 align="center">数学公式</h1> | ||
#### 使用 MathJax 给公式编号并引用公式 | ||
在新版本的 NexT 主题中,我们加入了公式自动编号和引用功能。下面简要介绍一下如何使用这项功能。 | ||
为了使用这项功能,一般来说,你必须把所使用的 LaTeX 公式放在 `equation` 环境里面,采用旧的方法(也就是说,仅仅把公式的每一边用两个 $ 符号包含起来)是无效的。如何引用公式?你只需要在书写公式的时候给公式一个 `\ | ||
label{}` 标记(tag),然后在正文中,可以使用 `\ref{}` 或者 `\eqref{}` 命令来引用对应的公式。使用 `\eqref{}` 是推荐的方式,因为如果你使用 `\ref{}`,公式在文中的引用编号将没有圆括号包围。下面介绍几种常见的公式编号例子。 | ||
对于简单的公式,使用下面的方式给公式一个标记, | ||
```latex | ||
$$\begin{equation} | ||
e=mc^2 | ||
\end{equation}\label{eq1}$$ | ||
``` | ||
然后,在正文中,你可以轻松引用上述公式,一个简单的例子如下: | ||
``` | ||
著名的质能方程 $\eqref{eq1}$ 由爱因斯坦提出 ... | ||
``` | ||
对于多行公式,在 `equation` 环境中,你可以使用 `aligned` 环境把公式分成多行, | ||
```latex | ||
$$\begin{equation} | ||
\begin{aligned} | ||
a &= b + c \\ | ||
&= d + e + f + g \\ | ||
&= h + i | ||
\end{aligned} | ||
\end{equation}\label{eq2}$$ | ||
``` | ||
要对齐多个公式,我们需要使用 `align` 环境。align 环境中的每个公式都有自己的编号: | ||
``` | ||
$$\begin{align} | ||
a &= b + c \label{eq3} \\ | ||
x &= yz \label{eq4}\\ | ||
l &= m - n \label{eq5} | ||
\end{align}$$ | ||
``` | ||
在 `align` 环境中,如果你不想给某个或某几个公式编号,那么在这些公式后面使用 [`\nonumber`](https://tex.stackexchange.com/questions/17528/show-equation-number-only-once-in-align-environment) 命令即可。例如: | ||
```latex | ||
$$\begin{align} | ||
-4 + 5x &= 2+y \nonumber \\ | ||
w+2 &= -1+w \\ | ||
ab &= cb | ||
\end{align}$$ | ||
``` | ||
有时,你可能会希望采用更加奇特的方式来标记和引用你的公式,你可以通过使用 `\tag{}` 命令来实现,例如: | ||
```latex | ||
$$x+1\over\sqrt{1-x^2} \tag{i}\label{eq_tag}$$ | ||
``` | ||
如果你想要了解更多信息,请访问 [MathJax 关于公式编号的官方文档](http://docs.mathjax.org/en/latest/tex.html#automatic-equation-numbering)。同时,你也可以访问[这篇博客](https://jdhao.github.io/2018/01/25/hexo-mathjax-equation-number/) 来获取更多细节信息。 | ||
### Katex | ||
@@ -52,0 +113,0 @@ |
@@ -105,13 +105,13 @@ <div align="right">语言: <a title="英语" href="../../README.md">:us:</a> | ||
[gitter-image]: https://badges.gitter.im/Join%20Chat.svg | ||
[gitter-image]: https://img.shields.io/badge/gitter-chat-orange.svg "Join to our Gitter room" | ||
[gitter-url]: https://gitter.im/theme-next | ||
[riot-image]: https://img.shields.io/badge/riot-join%20chat-green.svg | ||
[riot-image]: https://img.shields.io/badge/riot-chat-DCAB08.svg "Join to our Riot room" | ||
[riot-url]: https://riot.im/app/#/room/#NexT:matrix.org | ||
[t-chat-image]: https://img.shields.io/badge/telegram-chat-lightgrey.svg | ||
[t-chat-url]: https://t.me/joinchat/GUNHXA-vZkgSMuimL1VmMw | ||
[t-chat-image]: https://img.shields.io/badge/telegram-chat-BAB210.svg "Join to our Telegram group" | ||
[t-chat-url]: https://t.me/theme_next | ||
[t-news-image]: https://img.shields.io/badge/telegram-news-lightgrey.svg | ||
[t-news-url]: https://t.me/theme_next | ||
[t-news-image]: https://img.shields.io/badge/telegram-news-98B919.svg "Join to our Telegram news channel" | ||
[t-news-url]: https://t.me/theme_next_news | ||
@@ -118,0 +118,0 @@ [travis-image]: https://travis-ci.org/theme-next/hexo-theme-next.svg?branch=master |
{ | ||
"name": "hexo-theme-next", | ||
"version": "6.2.0", | ||
"version": "6.3.0", | ||
"description": "Elegant and powerful theme for Hexo", | ||
@@ -17,9 +17,7 @@ "main": "index.js", | ||
"keywords": [ | ||
"NexT", | ||
"Hexo" | ||
"hexo", | ||
"theme", | ||
"next" | ||
], | ||
"author": "iissnan <iissnan@gmail.com>", | ||
"maintainers": [ | ||
"Ivan Nginx <ivan.nginx@gmail.com> (https://almostover.ru)" | ||
], | ||
"author": "NexT <support@theme-next.org> (https://theme-next.org)", | ||
"license": "AGPL", | ||
@@ -26,0 +24,0 @@ "bugs": { |
@@ -105,13 +105,13 @@ <div align="right">Language: :us: | ||
[gitter-image]: https://badges.gitter.im/Join%20Chat.svg | ||
[gitter-image]: https://img.shields.io/badge/gitter-chat-orange.svg "Join to our Gitter room" | ||
[gitter-url]: https://gitter.im/theme-next | ||
[riot-image]: https://img.shields.io/badge/riot-join%20chat-green.svg | ||
[riot-image]: https://img.shields.io/badge/riot-chat-DCAB08.svg "Join to our Riot room" | ||
[riot-url]: https://riot.im/app/#/room/#NexT:matrix.org | ||
[t-chat-image]: https://img.shields.io/badge/telegram-chat-lightgrey.svg | ||
[t-chat-url]: https://t.me/joinchat/GUNHXA-vZkgSMuimL1VmMw | ||
[t-chat-image]: https://img.shields.io/badge/telegram-chat-BAB210.svg "Join to our Telegram group" | ||
[t-chat-url]: https://t.me/theme_next | ||
[t-news-image]: https://img.shields.io/badge/telegram-news-lightgrey.svg | ||
[t-news-url]: https://t.me/theme_next | ||
[t-news-image]: https://img.shields.io/badge/telegram-news-98B919.svg "Join to our Telegram news channel" | ||
[t-news-url]: https://t.me/theme_next_news | ||
@@ -118,0 +118,0 @@ [travis-image]: https://travis-ci.org/theme-next/hexo-theme-next.svg?branch=master |
'use strict'; | ||
hexo.extend.helper.register('hexo_env', function(type) { | ||
return this.env[type]; | ||
}); | ||
hexo.extend.helper.register('next_env', function(type) { | ||
var env = require('../package.json'); | ||
return env[type]; | ||
}); | ||
hexo.extend.helper.register('item_active', function(path, className) { | ||
@@ -15,5 +24,1 @@ var canonical = this.page.canonical_path; | ||
}); | ||
hexo.extend.helper.register('hexo_version', function() { | ||
return this.env.version; | ||
}); |
/* global hexo */ | ||
'use strict'; | ||
var merge = require('./merge'); | ||
/** | ||
* Merge configs from _data/next.yml into hexo.theme.config. | ||
* Note: configs in _data/next.yml will rewrite or override configs in hexo.theme.config. | ||
*/ | ||
hexo.on('generateBefore', function () { | ||
hexo.on('generateBefore', function() { | ||
if (hexo.locals.get) { | ||
var data = hexo.locals.get('data'); | ||
/** | ||
* 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 && data.next) { | ||
@@ -19,10 +23,24 @@ if (data.next.override) { | ||
} | ||
/** | ||
* If next.yml not exists, then merge all `theme_config.*` | ||
* options from main Hexo config into hexo.theme.config. | ||
*/ | ||
} else { | ||
merge(hexo.theme.config, hexo.config.theme_config); | ||
} | ||
// Custom languages support. Introduced in NexT v6.3.0. | ||
if (data && data.languages) { | ||
var lang = this.config.language; | ||
var i18n = this.theme.i18n; | ||
var mergeLang = function(lang) { | ||
i18n.set(lang, merge(i18n.get([lang]), data.languages[lang])); | ||
}; | ||
if (Array.isArray(lang)) { | ||
for (var i = 0; i < lang.length; i++) { | ||
mergeLang(lang[i]); | ||
} | ||
} else { | ||
mergeLang(lang); | ||
} | ||
} | ||
} | ||
}); |
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
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
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
1567230
11598
321