From 4d861d7175c0041ac7c2ecaae22914cde1fab066 Mon Sep 17 00:00:00 2001 From: Xin <5097752+imfing@users.noreply.github.com> Date: Thu, 14 Aug 2025 17:10:49 +0800 Subject: [PATCH] fix(katex): fall back to cdn when neither base or css is set --- layouts/_partials/scripts/katex.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/layouts/_partials/scripts/katex.html b/layouts/_partials/scripts/katex.html index 69e7384..2cd24fc 100644 --- a/layouts/_partials/scripts/katex.html +++ b/layouts/_partials/scripts/katex.html @@ -18,9 +18,13 @@ */ -}} {{- $noop := .WordCount -}} -{{- $katexBase := "https://cdn.jsdelivr.net/npm/katex@latest/dist" -}} +{{- $katexBase := "" -}} {{- with site.Params.math.katex.base -}} {{- $katexBase = . -}} +{{- else -}} + {{- if not site.Params.math.katex.css -}} + {{- $katexBase = "https://cdn.jsdelivr.net/npm/katex@latest/dist" -}} + {{- end -}} {{- end -}} {{- $katexCssAsset := "" -}}