mirror of
https://github.com/next-theme/hexo-theme-next.git
synced 2026-01-17 18:22:33 +00:00
New option mathjax.tags
This commit is contained in:
parent
851bf27836
commit
ff3b9571c0
@ -504,6 +504,8 @@ math:
|
||||
|
||||
mathjax:
|
||||
enable: false
|
||||
# Available values: none | ams | all
|
||||
tags: none
|
||||
|
||||
katex:
|
||||
enable: false
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
<aside class="sidebar">
|
||||
{%- set display_toc = page.toc.enable and 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 %}
|
||||
{%- endif %}
|
||||
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
{%- endfor %}
|
||||
{%- endif %}
|
||||
|
||||
{{ next_url(itemURL, menuIcon + menuText + menuBadge, {rel: 'section'}) }}
|
||||
{{- next_url(itemURL, menuIcon + menuText + menuBadge, {rel: 'section'}) -}}
|
||||
|
||||
</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 }}'],
|
||||
id : '{{ gitalk_md5(page.path) }}',
|
||||
{%- if theme.gitalk.language == '' %}
|
||||
language: window.navigator.language || window.navigator.userLanguage,
|
||||
language: window.navigator.language,
|
||||
{% else %}
|
||||
language: '{{ theme.gitalk.language }}',
|
||||
{%- endif %}
|
||||
|
||||
13
layout/_third-party/math/mathjax.njk
vendored
13
layout/_third-party/math/mathjax.njk
vendored
@ -3,21 +3,10 @@
|
||||
window.MathJax = {
|
||||
tex: {
|
||||
inlineMath: {'[+]': [['$', '$']]},
|
||||
tags: 'ams'
|
||||
tags: '{{ theme.math.mathjax.tags }}'
|
||||
},
|
||||
options: {
|
||||
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, () => {
|
||||
document.querySelectorAll('mjx-container').forEach(node => {
|
||||
const target = node.parentNode;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user