diff options
author | olOwOlo <26087907+olOwOlo@users.noreply.github.com> | 2018-02-13 16:19:47 +0800 |
---|---|---|
committer | olOwOlo <26087907+olOwOlo@users.noreply.github.com> | 2018-02-13 16:19:47 +0800 |
commit | 28b4c8a5dd8ca630b9eaed009e4bd611c7567375 (patch) | |
tree | 2363a1f0cbb784fdd59c6b1aa8245ab2c3f82210 /layouts/partials | |
parent | 33594c0d1307e1aad56823a7ac5ba6bb18a5d294 (diff) |
refactor: configure mathjax using plain javascript
If you use `x-mathjax-config` with CSP enabled, you will need to add 'unsafe-eval' to your CSP policy.
Diffstat (limited to 'layouts/partials')
-rw-r--r-- | layouts/partials/scripts.html | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html index 89c087a..3168f1d 100644 --- a/layouts/partials/scripts.html +++ b/layouts/partials/scripts.html @@ -12,14 +12,14 @@ <script type="text/javascript" src="{{ "dist/even.min.js?v=3.0.0" | relURL }}"></script> {{- if and (or .Params.mathjax (and .Site.Params.mathjax (ne .Params.mathjax false))) (or .IsPage .IsHome) }} - <script type="text/x-mathjax-config"> - MathJax.Hub.Config({ + <script type="text/javascript"> + window.MathJax = { {{ if or .Params.mathjaxEnableSingleDollar (and .Site.Params.mathjaxEnableSingleDollar (ne .Params.mathjaxEnableSingleDollar false)) -}} tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}, {{ end -}} showProcessingMessages: false, messageStyle: 'none' - }); + }; </script> <script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-MML-AM_CHTML"></script> {{- end }} |