hugo-geekdoc/layouts/shortcodes/katex.html

16 lines
541 B
HTML
Raw Normal View History

{{ if not (.Page.Scratch.Get "katex") }}
<!-- Include katext only first time -->
<link
rel="stylesheet"
href="{{ index (index .Site.Data.assets "katex.css") "src" | relURL }}"
/><script defer src="{{ index (index .Site.Data.assets "katex.js") "src" | relURL }}"></script>
{{ .Page.Scratch.Set "katex" true }}
{{ end }}
<span class="gdoc-katex katex{{ with .Get "class" }}{{ . }}{{ end }}">
{{ cond (in .Params "display") "\\[" "\\(" -}}
{{- trim .Inner "\n" -}}
{{- cond (in .Params "display") "\\]" "\\)" }}
</span>