From 0f4cb100abf2617e2d02990c119fb63b638f89d3 Mon Sep 17 00:00:00 2001 From: Andreas Deininger Date: Mon, 9 Jan 2023 14:53:55 +0100 Subject: [PATCH] Math and chem code clocks, autoactivation: fix for use with hugo version < 0.93 --- layouts/partials/scripts.html | 6 ++++-- userguide/config.yaml | 5 ----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html index c7e3654882..21b4d550a3 100644 --- a/layouts/partials/scripts.html +++ b/layouts/partials/scripts.html @@ -1,10 +1,12 @@ -{{ $needKaTeX := or .Site.Params.katex.enable .Params.math .Params.chem (.Page.Store.Get "hasKaTeX") (.Page.Store.Get "hasmhchem") -}} -{{ $needmhchem := or .Site.Params.katex.mhchem.enable .Params.chem (.Page.Store.Get "hasmhchem") -}} +{{ $needKaTeX := or .Site.Params.katex.enable .Params.math .Params.chem -}} +{{ $needmhchem := or .Site.Params.katex.mhchem.enable .Params.chem -}} {{ $needmermaid := .Site.Params.mermaid.enable -}} {{ if ge hugo.Version "0.93.0" -}} {{ with .Site.Params.mermaid }} {{ $needmermaid = true }} {{ end }} + {{ $needKaTeX = or $needKaTeX (.Page.Store.Get "hasKaTeX") (.Page.Store.Get "hasmhchem") -}} + {{ $needmhchem = or $needmhchem (.Page.Store.Get "hasmhchem") -}} {{ $needmermaid = or $needmermaid (.Page.Store.Get "hasmermaid") -}} {{ else -}} {{ if or $needKaTeX $needmhchem $needmermaid -}} diff --git a/userguide/config.yaml b/userguide/config.yaml index 25df4bff58..86d400b81b 100644 --- a/userguide/config.yaml +++ b/userguide/config.yaml @@ -111,11 +111,6 @@ params: theme: default svg_image_url: https://www.plantuml.com/plantuml/svg/ svg: false - katex: - enable: true - html_dom_element: document.body - mhchem: - enable: true print: disable_toc: false markmap: