mirror of
https://github.com/next-theme/hexo-theme-next.git
synced 2026-01-19 18:42:34 +00:00
New option mathjax.tags
This commit is contained in:
parent
851bf27836
commit
ff3b9571c0
@ -504,6 +504,8 @@ math:
|
|||||||
|
|
||||||
mathjax:
|
mathjax:
|
||||||
enable: false
|
enable: false
|
||||||
|
# Available values: none | ams | all
|
||||||
|
tags: none
|
||||||
|
|
||||||
katex:
|
katex:
|
||||||
enable: false
|
enable: false
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
<aside class="sidebar">
|
<aside class="sidebar">
|
||||||
{%- set display_toc = page.toc.enable and display_toc %}
|
{%- set display_toc = page.toc.enable and display_toc %}
|
||||||
{%- if display_toc %}
|
{%- if display_toc %}
|
||||||
{%- set toc = toc(page.content, { class: "nav", list_number: page.toc.number, max_depth: page.toc.max_depth }) %}
|
{%- set toc = toc(page.content, {class: 'nav', list_number: page.toc.number, max_depth: page.toc.max_depth}) %}
|
||||||
{%- set display_toc = toc.length > 1 and display_toc %}
|
{%- set display_toc = toc.length > 1 and display_toc %}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
|
|||||||
@ -24,7 +24,7 @@
|
|||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
{{ next_url(itemURL, menuIcon + menuText + menuBadge, {rel: 'section'}) }}
|
{{- next_url(itemURL, menuIcon + menuText + menuBadge, {rel: 'section'}) -}}
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|||||||
2
layout/_third-party/comments/gitalk.njk
vendored
2
layout/_third-party/comments/gitalk.njk
vendored
@ -12,7 +12,7 @@ NexT.utils.loadComments('#gitalk-container', () => {
|
|||||||
admin : ['{{ theme.gitalk.admin_user }}'],
|
admin : ['{{ theme.gitalk.admin_user }}'],
|
||||||
id : '{{ gitalk_md5(page.path) }}',
|
id : '{{ gitalk_md5(page.path) }}',
|
||||||
{%- if theme.gitalk.language == '' %}
|
{%- if theme.gitalk.language == '' %}
|
||||||
language: window.navigator.language || window.navigator.userLanguage,
|
language: window.navigator.language,
|
||||||
{% else %}
|
{% else %}
|
||||||
language: '{{ theme.gitalk.language }}',
|
language: '{{ theme.gitalk.language }}',
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|||||||
13
layout/_third-party/math/mathjax.njk
vendored
13
layout/_third-party/math/mathjax.njk
vendored
@ -3,21 +3,10 @@
|
|||||||
window.MathJax = {
|
window.MathJax = {
|
||||||
tex: {
|
tex: {
|
||||||
inlineMath: {'[+]': [['$', '$']]},
|
inlineMath: {'[+]': [['$', '$']]},
|
||||||
tags: 'ams'
|
tags: '{{ theme.math.mathjax.tags }}'
|
||||||
},
|
},
|
||||||
options: {
|
options: {
|
||||||
renderActions: {
|
renderActions: {
|
||||||
findScript: [10, doc => {
|
|
||||||
document.querySelectorAll('script[type^="math/tex"]').forEach(node => {
|
|
||||||
const display = !!node.type.match(/; *mode=display/);
|
|
||||||
const math = new doc.options.MathItem(node.textContent, doc.inputJax[0], display);
|
|
||||||
const text = document.createTextNode('');
|
|
||||||
node.parentNode.replaceChild(text, node);
|
|
||||||
math.start = {node: text, delim: '', n: 0};
|
|
||||||
math.end = {node: text, delim: '', n: 0};
|
|
||||||
doc.math.push(math);
|
|
||||||
});
|
|
||||||
}, '', false],
|
|
||||||
insertedScript: [200, () => {
|
insertedScript: [200, () => {
|
||||||
document.querySelectorAll('mjx-container').forEach(node => {
|
document.querySelectorAll('mjx-container').forEach(node => {
|
||||||
const target = node.parentNode;
|
const target = node.parentNode;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user