add mathjax
This commit is contained in:
15
assets/js/mathjax.js
Normal file
15
assets/js/mathjax.js
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
|
MathJax = {
|
||||||
|
tex: {
|
||||||
|
inlineMath: [
|
||||||
|
['$', '$'],
|
||||||
|
['\\(', '\\)']
|
||||||
|
],
|
||||||
|
displayMath: [
|
||||||
|
['$$', '$$'],
|
||||||
|
['\\[', '\\]']
|
||||||
|
],
|
||||||
|
tags: 'ams'
|
||||||
|
}
|
||||||
|
};
|
||||||
|
});
|
@ -85,11 +85,10 @@
|
|||||||
|
|
||||||
{{ if .Params.math }}
|
{{ if .Params.math }}
|
||||||
<!-- MathJax -->
|
<!-- MathJax -->
|
||||||
{{ $mathjaxConfig := resources.Get "js/data/mathjax.js" | minify | fingerprint }}
|
{{ $mathjaxConfig := resources.Get "js/mathjax.js" | minify | fingerprint }}
|
||||||
<script async src="{{ $mathjaxConfig.RelPermalink }}"></script>
|
<script src="{{ $mathjaxConfig.RelPermalink }}"></script>
|
||||||
<script async src="https://cdnjs.cloudflare.com/polyfill/v3/polyfill.min.js?features=es6"></script>
|
<script async src="https://cdnjs.cloudflare.com/polyfill/v3/polyfill.min.js?features=es6"></script>
|
||||||
{{ $mathjax := (index site.Data.origin site.Params.cdn).mathjax.js }}
|
<script id="MathJax-script" async src="{{ $data.mathjax.js }}"></script>
|
||||||
<script id="MathJax-script" async src="{{ $mathjax }}"></script>
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
<!-- Pageviews -->
|
<!-- Pageviews -->
|
||||||
|
Reference in New Issue
Block a user