mirror of
https://github.com/next-theme/hexo-theme-next.git
synced 2026-09-13 06:40: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=
|
||||
mathjax:
|
||||
name: mathjax
|
||||
version: 3.2.2
|
||||
file: es5/tex-mml-chtml.js
|
||||
integrity: sha256-MASABpB4tYktI2Oitl4t+78w/lyA+D7b/s9GEP0JOGI=
|
||||
version: 4.1.3
|
||||
file: tex-mml-chtml.js
|
||||
integrity: sha256-ihPtDDm7pTmSF9ViEsItlvsrBTsNkz0MOXMchzOwCQw=
|
||||
katex:
|
||||
name: katex
|
||||
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, {
|
||||
js: theme.vendors.mathjax
|
||||
js: theme.vendors.mathjax,
|
||||
font_path: theme.vendors.mathjax_font_path
|
||||
}) }}
|
||||
{{ next_js('third-party/math/mathjax.js') }}
|
||||
|
||||
@ -57,5 +57,10 @@ module.exports = hexo => {
|
||||
// Omit integrity for local assets.
|
||||
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]
|
||||
}
|
||||
}
|
||||
},
|
||||
output: CONFIG.mathjax.font_path ? {
|
||||
fontPath: CONFIG.mathjax.font_path
|
||||
} : {}
|
||||
};
|
||||
NexT.utils.getScript(CONFIG.mathjax.js, {
|
||||
attributes: {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user