diff options
author | Greg Sadowy <email not available> | 2017-01-20 21:30:50 +0300 |
---|---|---|
committer | Greg Sadowy <email not available> | 2017-01-20 21:30:50 +0300 |
commit | 6af05b2d649f86afccf276b0e8a636ad78fab376 (patch) | |
tree | 7bf489a0baa6d2663cc7332257ca4613159da7f3 | |
parent | 5e3f13e738fa6d9f3244b1fd1a66403f64668170 (diff) |
Added option to disable MathJax
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | exampleSite/config.toml | 1 | ||||
-rw-r--r-- | layouts/partials/footer_js.html | 3 |
3 files changed, 4 insertions, 1 deletions
@@ -133,6 +133,7 @@ Mathematical equations in form of LaTeX or MathML code can be rendered with the You can also print formulas inline. In this case wrap the formula only once with `$`. +If you don't need equations, you can disable MathJax but putting `mathjax = false` in your config.toml. This will prevent clients from unnecessarily downloading the MathJax library. ## Shortcodes diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 17020b2..c299ded 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -24,6 +24,7 @@ theme = "hugo-icarus-theme" copyright = "Powered by [Hugo](//gohugo.io). Theme by [PPOffice](http://github.com/ppoffice)." avatar = "css/images/avatar.png" logo = "css/images/logo.png" + mathjax = true # set to false to disable MathJax # Format dates with Go's time formatting date_format = "2006-01-02" diff --git a/layouts/partials/footer_js.html b/layouts/partials/footer_js.html index 1b31a03..3b9cdba 100644 --- a/layouts/partials/footer_js.html +++ b/layouts/partials/footer_js.html @@ -7,7 +7,7 @@ <script src="{{ . | absURL }}"></script> {{ end }} -{{ "<!-- MathJax -->" | safeHTML }} +{{ if .Site.Params.mathjax }} <script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { @@ -15,3 +15,4 @@ MathJax.Hub.Config({ }); </script> <script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script> +{{ end }}
\ No newline at end of file |