diff --git a/config.json b/config.json index 5a58510..297e929 100644 --- a/config.json +++ b/config.json @@ -37,6 +37,20 @@ "card": "color", "note": "颜色字符串:(如:#EEEEEE、rgba(255, 255, 255, 0.9))" }, + { + "name": "renderKaTeX", + "label": "是否渲染 KaTeX 公式", + "group": "渲染", + "value": false, + "type": "switch" + }, + { + "name": "renderCode", + "label": "是否渲染代码高亮", + "group": "渲染", + "value": false, + "type": "switch" + }, { "name": "github", "label": "Github", diff --git a/templates/_blocks/head.ejs b/templates/_blocks/head.ejs index 033fc35..8295241 100644 --- a/templates/_blocks/head.ejs +++ b/templates/_blocks/head.ejs @@ -1,13 +1,11 @@ <%= siteTitle %> - - <% if (typeof commentSetting !== 'undefined' && commentSetting.showComment) { %> @@ -20,10 +18,8 @@ <% } %> <% } %> - - - + <% if (site.customConfig.ga) { %> diff --git a/templates/_blocks/scripts.ejs b/templates/_blocks/scripts.ejs index 2f4277b..a94331e 100644 --- a/templates/_blocks/scripts.ejs +++ b/templates/_blocks/scripts.ejs @@ -1,11 +1,8 @@ - +<% if (site.customConfig.renderCode) { %> + + +<% } %> + <% if (typeof commentSetting !== 'undefined' && commentSetting.showComment) { %> <% if (commentSetting.commentPlatform === 'gitalk') { %> diff --git a/templates/archives.ejs b/templates/archives.ejs index f107d75..9f0c4de 100644 --- a/templates/archives.ejs +++ b/templates/archives.ejs @@ -2,6 +2,7 @@ <%- include('./_blocks/head', { siteTitle: `文章归档 | ${themeConfig.siteName}` }) %> +
diff --git a/templates/index.ejs b/templates/index.ejs index bd68e9e..cf0a82a 100644 --- a/templates/index.ejs +++ b/templates/index.ejs @@ -2,6 +2,10 @@ <%- include('./_blocks/head', { siteTitle: themeConfig.siteName }) %> + + <% if (site.customConfig.renderKaTeX) { %> + + <% } %>
diff --git a/templates/post.ejs b/templates/post.ejs index 975ddc6..1821487 100644 --- a/templates/post.ejs +++ b/templates/post.ejs @@ -2,6 +2,8 @@ <%- include('./_blocks/head', { siteTitle: `${post.title} | ${themeConfig.siteName}` }) %> + +
@@ -17,7 +19,7 @@
<% } %> -
+
<%- post.content %>
<% if (post.tags.length > 0) { %> diff --git a/templates/tag.ejs b/templates/tag.ejs index 486b70a..30e8163 100644 --- a/templates/tag.ejs +++ b/templates/tag.ejs @@ -2,6 +2,7 @@ <%- include('./_blocks/head', { siteTitle: `${tag.name} | ${themeConfig.siteName}` }) %> +
diff --git a/templates/tags.ejs b/templates/tags.ejs index 9a43511..3c80c48 100644 --- a/templates/tags.ejs +++ b/templates/tags.ejs @@ -2,6 +2,7 @@ <%- include('./_blocks/head', { siteTitle: `标签列表 | ${themeConfig.siteName}` }) %> +