From 6f7bd1b933b2ed24569b90645510804b607ff428 Mon Sep 17 00:00:00 2001 From: Chun-Hung Tseng Date: Mon, 15 Jan 2018 22:22:14 +0800 Subject: [PATCH] feat: config mathjax to use $...$ for in-line math mode (#22) * Update cdn mathjax version to 2.7.2 --- archetypes/default.md | 1 + exampleSite/config.toml | 1 + layouts/partials/scripts.html | 11 +++++++---- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/archetypes/default.md b/archetypes/default.md index dd9dc12..5a49b9e 100644 --- a/archetypes/default.md +++ b/archetypes/default.md @@ -18,6 +18,7 @@ autoCollapseToc: false contentCopyright: false reward: false mathjax: false +mathjaxEnableSingleDollar: false --- diff --git a/exampleSite/config.toml b/exampleSite/config.toml index e2ed85c..bfb229c 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -67,6 +67,7 @@ copyright = "" # default: author.name ↓ # 默认为下面配 fancybox = true # see https://github.com/fancyapps/fancybox # 是否启用fancybox(图片可点击) bootcdn = false # In china. @Deprecated: use [params.publicCDN] # 是否使用bootcdn(@Deprecated: 请使用[params.publicCDN]) mathjax = false # see https://www.mathjax.org/ # 是否使用mathjax(数学公式) + mathjaxEnableSingleDollar = false # 是否使用 $...$ 即可進行inline latex渲染 linkToMarkDown = false # if you config contentCopyright and hugo output .md files. # 是否在链接到markdown原始文件(如果你配置了下面的许可协议并允许hugo生成markdown文件) contentCopyright = 'CC BY-NC-ND 4.0' diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html index 1a284ee..2cfa68a 100644 --- a/layouts/partials/scripts.html +++ b/layouts/partials/scripts.html @@ -16,13 +16,16 @@ {{- if and (or .Params.mathjax (and .Site.Params.mathjax (ne .Params.mathjax false))) (or .IsPage .IsHome) }} - - + {{- end }}