Adjustments to the katex integration.

This commit is contained in:
Fredrik Jonsson 2023-03-17 14:12:34 +01:00
commit 5033f3a277
2 changed files with 15 additions and 40 deletions

View file

@ -10,6 +10,7 @@
{{ partial "meta_json_ld.html" . }}
{{ partial "scripts.html" . }}
{{ partialCached "tracking.html" . }}
{{ if $.Param "math" }}{{ partial "math.html" . }}{{ end -}}
</head>
<body class="{{ if .IsPage }}single-page{{ else }}list-page{{ end }}{{ if .IsHome }} front{{ end }}{{ with $.Param "bodyclass" }} {{ . }}{{ end }}">
@ -28,7 +29,6 @@
{{ if $.Param "menuinheader" }}{{ partial "menu.html" . }}{{ end -}}
</div>
{{ if $.Param "mobilemenu" }}{{ partial "mobilemenu.html" . }}{{ end -}}
{{ if $.Param "math" }}{{ partial "math.html" . }}{{ end -}}
</header>
{{ if not ($.Param "menuinheader") }}{{ partial "menu.html" . }}{{ end -}}
@ -43,8 +43,8 @@
{{ with $.Param "footer" }}<p>{{ . | markdownify }}</p>{{ end }}
{{ if $.Param "poweredby" }}<p>Powered by <a href="https://gohugo.io/">Hugo</a> and the <a href="https://github.com/frjo/hugo-theme-zen">Zen theme</a>.</p>{{ end }}
</footer>
{{ if $.Param "cookieconsent" }}{{ partial "cookieconsent.html" . }}{{ end -}}
{{ if $.Param "cookieconsent" }}{{ partial "cookieconsent.html" . }}{{ end -}}
</div>
</body>
</html>

View file

@ -1,11 +1,6 @@
{{ $katex_style := resources.Get "vendor/katex/katex.min.css" -}}
<link rel="stylesheet" href="{{ $katex_style.RelPermalink }}" >
{{ $katex := resources.Get "vendor/katex/katex.min.js" }}
<script defer src="{{ $katex.RelPermalink }}" crossorigin="anonymous"></script>
{{ $auto_render := resources.Get "vendor/katex/auto-render.min.js" }}
<script defer src="{{ $auto_render.RelPermalink }}" crossorigin="anonymous"></script>
{{ $customized_render := resources.Get "js/math.js" }}
<script defer src="{{ $customized_render.RelPermalink }}" crossorigin="anonymous"></script>
{{ $katex_style := resources.Get "vendor/katex/katex.min.css" | fingerprint -}}
<link rel="stylesheet" href="{{ $katex_style.RelPermalink }}">
{{ $katex := resources.Get "vendor/katex/katex.min.js" | fingerprint -}}
<script defer src="{{ $katex.RelPermalink }}"></script>
{{ $auto_render := resources.Get "vendor/katex/contrib/auto-render.min.js" | fingerprint -}}
<script defer src="{{ $auto_render.RelPermalink }}" onload="renderMathInElement(document.body);"></script>