Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/monkeyWzr/hugo-theme-cactus.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormonkeyWzr <monkeywzr@gmail.com>2020-07-24 11:40:05 +0300
committermonkeyWzr <monkeywzr@gmail.com>2020-07-24 11:40:05 +0300
commit0d3f08d357545a25bca8bbcdfbddfc41835e35b1 (patch)
tree4e8b503c1042be2d66f63717ac95715cad614d85 /layouts/posts
parent8b9e083afcd3285561a16ffe1d5e1b4572dfe29e (diff)
add mathjax support
Diffstat (limited to 'layouts/posts')
-rw-r--r--layouts/posts/single.html21
1 files changed, 21 insertions, 0 deletions
diff --git a/layouts/posts/single.html b/layouts/posts/single.html
index b236e46..dab8de5 100644
--- a/layouts/posts/single.html
+++ b/layouts/posts/single.html
@@ -77,4 +77,25 @@
<link rel="stylesheet" href="/lib/font-awesome/css/all.min.css">
<script src="/lib/jquery/jquery.min.js"></script>
<script src="/js/main.js"></script>
+{{ $mathjax := false }}
+{{ if isset .Params "mathjax" }}
+ {{ $mathjax = .Params.mathjax }}
+{{ else if isset .Site.Params "mathjax" }}
+ {{ $mathjax = .Site.Params.mathjax }}
+{{ end }}
+{{ if $mathjax }}
+<script>
+ MathJax = {
+ tex: {
+ inlineMath: [['$', '$'], ['\\(', '\\)']]
+ },
+ svg: {
+ fontCache: 'global'
+ }
+ };
+</script>
+<script type="text/javascript" id="MathJax-script" async
+ src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js">
+</script>
+{{ end }}
</html>