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

github.com/nanxstats/hugo-tanka.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNan Xiao <road2stat@gmail.com>2017-12-28 06:15:18 +0300
committerNan Xiao <road2stat@gmail.com>2017-12-28 06:15:18 +0300
commit532567bef67d89a92e0160667992b87717a6cda2 (patch)
treeb98f34233ba2adad451c9cf0d26cb230fd863223
parentb728394117cebc196db4f46ace5396eec9bc8090 (diff)
fix mathjax
-rw-r--r--exampleSite/config.toml1
-rw-r--r--layouts/partials/footer.html4
-rw-r--r--layouts/partials/footer_mathjax.html4
3 files changed, 6 insertions, 3 deletions
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index 2cdb5cb..dd3fcee 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -7,6 +7,7 @@ languagecode = "en"
theme = "hugo-tanka"
googleAnalytics = ""
disqusShortname = ""
+disable_mathjax = false
pygmentsstyle = "vs"
pygmentscodefences = true
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
index 7ab6335..97481ec 100644
--- a/layouts/partials/footer.html
+++ b/layouts/partials/footer.html
@@ -1,7 +1,5 @@
{{ template "_internal/google_analytics_async.html" . }}
-
- <script src="js/math-code.js"></script>
- <script type="text/javascript" async src="//cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_CHTML"></script>
+ {{ partial "footer_mathjax.html" . }}
</body>
</html>
diff --git a/layouts/partials/footer_mathjax.html b/layouts/partials/footer_mathjax.html
new file mode 100644
index 0000000..7da95a1
--- /dev/null
+++ b/layouts/partials/footer_mathjax.html
@@ -0,0 +1,4 @@
+{{ if and (not .Params.disable_mathjax) (or (in (string .Content) "\\") (in (string .Content) "$")) }}
+<script src="{{ "/js/math-code.js" | relURL }}"></script>
+<script async src="{{ .Site.Params.MathJaxCDN | default "//cdnjs.cloudflare.com/ajax/libs" }}/mathjax/{{ .Site.Params.MathJaxVersion | default "2.7.1" }}/MathJax.js?config=TeX-MML-AM_CHTML"></script>
+{{ end }}