From 6af05b2d649f86afccf276b0e8a636ad78fab376 Mon Sep 17 00:00:00 2001 From: Greg Sadowy Date: Fri, 20 Jan 2017 10:30:50 -0800 Subject: Added option to disable MathJax --- README.md | 1 + exampleSite/config.toml | 1 + layouts/partials/footer_js.html | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 898110c..3a03def 100644 --- a/README.md +++ b/README.md @@ -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 @@ {{ end }} -{{ "" | safeHTML }} +{{ if .Site.Params.mathjax }} +{{ end }} \ No newline at end of file -- cgit v1.2.3