mirror of
https://github.com/next-theme/hexo-theme-next.git
synced 2026-09-14 06:50:20 +00:00
Support MathJax 4 (#985)
This commit is contained in:
parent
091af0fd4f
commit
c0232764b3
@ -27,9 +27,9 @@ prism_line_numbers:
|
|||||||
integrity: sha256-9cmf7tcLdXpKsPi/2AWE93PbZpTp4M4tqzFk+lWomjU=
|
integrity: sha256-9cmf7tcLdXpKsPi/2AWE93PbZpTp4M4tqzFk+lWomjU=
|
||||||
mathjax:
|
mathjax:
|
||||||
name: mathjax
|
name: mathjax
|
||||||
version: 3.2.2
|
version: 4.1.3
|
||||||
file: es5/tex-mml-chtml.js
|
file: tex-mml-chtml.js
|
||||||
integrity: sha256-MASABpB4tYktI2Oitl4t+78w/lyA+D7b/s9GEP0JOGI=
|
integrity: sha256-ihPtDDm7pTmSF9ViEsItlvsrBTsNkz0MOXMchzOwCQw=
|
||||||
katex:
|
katex:
|
||||||
name: katex
|
name: katex
|
||||||
version: 0.16.9
|
version: 0.16.9
|
||||||
|
|||||||
3
layout/_third-party/math/mathjax.njk
vendored
3
layout/_third-party/math/mathjax.njk
vendored
@ -1,4 +1,5 @@
|
|||||||
{{ next_data('mathjax', theme.math.mathjax, {
|
{{ next_data('mathjax', theme.math.mathjax, {
|
||||||
js: theme.vendors.mathjax
|
js: theme.vendors.mathjax,
|
||||||
|
font_path: theme.vendors.mathjax_font_path
|
||||||
}) }}
|
}) }}
|
||||||
{{ next_js('third-party/math/mathjax.js') }}
|
{{ next_js('third-party/math/mathjax.js') }}
|
||||||
|
|||||||
@ -57,5 +57,10 @@ module.exports = hexo => {
|
|||||||
// Omit integrity for local assets.
|
// Omit integrity for local assets.
|
||||||
integrity: plugins === 'local' ? undefined : value.integrity
|
integrity: plugins === 'local' ? undefined : value.integrity
|
||||||
};
|
};
|
||||||
|
if (key === 'mathjax') {
|
||||||
|
vendors.mathjax_font_path = plugins === 'local'
|
||||||
|
? url_for.call(hexo, 'lib/@mathjax/mathjax-newcm-font')
|
||||||
|
: undefined;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
5
source/js/third-party/math/mathjax.js
vendored
5
source/js/third-party/math/mathjax.js
vendored
@ -20,7 +20,10 @@ document.addEventListener('page:loaded', () => {
|
|||||||
});
|
});
|
||||||
}, '', false]
|
}, '', false]
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
output: CONFIG.mathjax.font_path ? {
|
||||||
|
fontPath: CONFIG.mathjax.font_path
|
||||||
|
} : {}
|
||||||
};
|
};
|
||||||
NexT.utils.getScript(CONFIG.mathjax.js, {
|
NexT.utils.getScript(CONFIG.mathjax.js, {
|
||||||
attributes: {
|
attributes: {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user