Add support for LaTeX in posts

attemptAtTagsRenovation
Jack Jackson 2 years ago
parent 2e79b15c79
commit b290e70ece
  1. 4
      blog/layouts/partials/head-additions.html
  2. 4
      blog/layouts/partials/helpers/katex.html

@ -1,2 +1,4 @@
<!-- https://stackoverflow.com/a/70385342/1040915 -->
<script src="js/custom.js" defer></script>
<script src="js/custom.js" defer></script>
<!-- https://mertbakir.gitlab.io/hugo/math-typesetting-in-hugo/ -->
{{ if .Params.math }}{{ partial "helpers/katex.html" . }}{{ end }}

@ -0,0 +1,4 @@
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.15.0/dist/katex.min.css">
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.15.0/dist/katex.min.js"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.15.0/dist/contrib/auto-render.min.js" onload="renderMathInElement(document.body);"></script>
Loading…
Cancel
Save