From dd3a05402bff93cf416b78b8305511afa19411c6 Mon Sep 17 00:00:00 2001 From: FilouPlains Date: Wed, 6 Nov 2024 17:57:51 +0100 Subject: [PATCH] Adding offline MathJax and Mermaid. --- layouts/partials/layout/javascript.html | 27 +++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/layouts/partials/layout/javascript.html b/layouts/partials/layout/javascript.html index 72131ef..d6b8f71 100644 --- a/layouts/partials/layout/javascript.html +++ b/layouts/partials/layout/javascript.html @@ -68,15 +68,23 @@ {{ end }} {{ if $hasMermaid }} - {{ $mermaidSrc := resources.GetRemote "https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js" }} - - - -{{ $mathjaxSrc := resources.GetRemote "https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js" }} - + + {{- $mathjax_location := $.Param "reveal_hugo.mathjax_cdn" | default "__fetch_cdn__" -}} + + {{ if eq $mathjax_location "__fetch_cdn__" }} + {{ $mathjax_location := resources.GetRemote "https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js" }} + + {{ else }} + + {{ end }} {{ end }} {{- $custom_js := $.Param "reveal_hugo.custom_js" -}}