From a3cab1a3542932c3a9ed53d5dbca7158efe3120f Mon Sep 17 00:00:00 2001
From: olOwOlo <26087907+olOwOlo@users.noreply.github.com>
Date: Fri, 6 Jul 2018 22:24:47 +0800
Subject: [PATCH] feat(mathjax): configure to let mathjax use local files
Close #63
---
exampleSite/config.toml | 3 +++
layouts/partials/scripts.html | 6 +++++-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index a41c74f..624cc0b 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -70,9 +70,12 @@ copyright = "" # default: author.name ↓ # 默认为下面配
toc = true # 是否开启目录
autoCollapseToc = false # Auto expand and collapse toc # 目录自动展开/折叠
fancybox = true # see https://github.com/fancyapps/fancybox # 是否启用fancybox(图片可点击)
+
+ # mathjax
mathjax = false # see https://www.mathjax.org/ # 是否使用mathjax(数学公式)
mathjaxEnableSingleDollar = false # 是否使用 $...$ 即可進行inline latex渲染
mathjaxEnableAutoNumber = false # 是否使用公式自动编号
+ mathjaxUseLocalFiles = false # You should install mathjax in `yout-site/static/lib/mathjax`
postMetaInFooter = true # contain author, lastMod, markdown link, license # 包含作者,上次修改时间,markdown链接,许可信息
linkToMarkDown = false # Only effective when hugo will output .md files. # 链接到markdown原始文件(仅当允许hugo生成markdown文件时有效)
diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html
index 1a71393..b9c9a55 100644
--- a/layouts/partials/scripts.html
+++ b/layouts/partials/scripts.html
@@ -78,7 +78,11 @@
messageStyle: 'none'
};
-
+ {{ if .Site.Params.mathjaxUseLocalFiles -}}
+
+ {{- else -}}
+
+ {{- end }}
{{- end }}