From 071214d1f3206e010469bdc25241b513b5bd603d Mon Sep 17 00:00:00 2001 From: geekifan Date: Sun, 27 Apr 2025 11:35:06 +0800 Subject: [PATCH] add mathjax --- assets/js/mathjax.js | 15 +++++++++++++++ layouts/partials/js-selector.html | 7 +++---- 2 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 assets/js/mathjax.js diff --git a/assets/js/mathjax.js b/assets/js/mathjax.js new file mode 100644 index 0000000..c5e15d5 --- /dev/null +++ b/assets/js/mathjax.js @@ -0,0 +1,15 @@ +document.addEventListener('DOMContentLoaded', () => { + MathJax = { + tex: { + inlineMath: [ + ['$', '$'], + ['\\(', '\\)'] + ], + displayMath: [ + ['$$', '$$'], + ['\\[', '\\]'] + ], + tags: 'ams' + } + }; +}); \ No newline at end of file diff --git a/layouts/partials/js-selector.html b/layouts/partials/js-selector.html index 847f1ea..b86ba9a 100644 --- a/layouts/partials/js-selector.html +++ b/layouts/partials/js-selector.html @@ -85,11 +85,10 @@ {{ if .Params.math }} - {{ $mathjaxConfig := resources.Get "js/data/mathjax.js" | minify | fingerprint }} - + {{ $mathjaxConfig := resources.Get "js/mathjax.js" | minify | fingerprint }} + - {{ $mathjax := (index site.Data.origin site.Params.cdn).mathjax.js }} - + {{ end }}