feat(mathjax): configure to let mathjax use local files

Close #63
This commit is contained in:
olOwOlo 2018-07-06 22:24:47 +08:00
parent cec9ea91bc
commit a3cab1a354
No known key found for this signature in database
GPG key ID: 456394B6E7A15EA6
2 changed files with 8 additions and 1 deletions

View file

@ -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文件时有效

View file

@ -78,8 +78,12 @@
messageStyle: 'none'
};
</script>
{{ if .Site.Params.mathjaxUseLocalFiles -}}
<script type="text/javascript" async src="{{ "lib/mathjax/MathJax.js?config=TeX-MML-AM_CHTML" | relURL }}"></script>
{{- else -}}
<script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-MML-AM_CHTML"></script>
{{- end }}
{{- end }}
<!-- Analytics -->
{{- if .Site.GoogleAnalytics -}}