From 841614f784997c38af3b4f7d0c8b52477e953122 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=81=8A=E7=94=B1?=
<84276102+hermitlsr@users.noreply.github.com>
Date: Fri, 10 Jun 2022 23:30:59 +0800
Subject: [PATCH] =?UTF-8?q?=E5=85=AC=E5=BC=8F=E6=94=AF=E6=8C=81=20-=20Kate?=
=?UTF-8?q?x=20(#94)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 使用 hexo-renderer-markdown-it-plus 作为渲染器
- 支持多种复杂的公式
- 目前尚在更新维护
---
_config.yml | 9 +++++++++
layout/_partial/head.ejs | 6 ++++++
2 files changed, 15 insertions(+)
diff --git a/_config.yml b/_config.yml
index 901449d..8bc1282 100755
--- a/_config.yml
+++ b/_config.yml
@@ -310,6 +310,15 @@ plugins:
enable: false
cdn: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.6/MathJax.js?config=TeX-AMS-MML_HTMLorMML
+ # Katex - The fastest math typesetting library for the web
+ # https://katex.org/docs/autorender.html
+ # https://github.com/KaTeX/KaTeX
+ # 使用 hexo-renderer-markdown-it-plus 作为公式渲染器:npm uninstall hexo-renderer-marked --save npm install hexo-renderer-markdown-it-plus --save
+ katex:
+ enable: false
+ min_css:
+ min_js:
+ auto_render_min_js:
style:
darkmode: auto # auto / always / false
diff --git a/layout/_partial/head.ejs b/layout/_partial/head.ejs
index 9b02e82..7a650f5 100755
--- a/layout/_partial/head.ejs
+++ b/layout/_partial/head.ejs
@@ -86,6 +86,12 @@ function og_args() {
<%- css(theme.style.codeblock.highlightjs_theme) %>
<% } %>
+ <% if (theme.plugins.katex && theme.plugins.katex.enable) { %>
+ <%- theme.plugins.katex.min_css %>
+ <%- theme.plugins.katex.min_js %>
+ <%- theme.plugins.katex.auto_render_min_js %>
+ <% } %>
+
<% if (config.inject && config.inject.head){ %>
<% (config.inject.head||[]).forEach(function(item){ %>