hacker.tours-website/themes/zen/layouts/partials/math.html
2024-06-13 22:14:05 +02:00

12 lines
573 B
HTML

{{ $opts := dict "minify" true -}}
{{ if eq hugo.Environment "development" -}}
{{ $opts = merge $opts (dict "minify" false) -}}
{{ end -}}
{{ if or ($.Param "math") (.Page.Store.Get "math") (.HasShortcode "math") -}}
<link rel="stylesheet" href="{{ "katex/katex.min.css" | relURL }}">
<script defer src="{{ "katex/katex.min.js" | relURL }}"></script>
<script defer src="{{ "katex/contrib/auto-render.min.js" | relURL }}"></script>
{{ $math := resources.Get "js/math.js" | js.Build $opts | fingerprint -}}
<script defer src="{{ $math.RelPermalink }}"></script>
{{ end -}}