diff options
author | nodejh <jianghangscu@gmail.com> | 2021-08-16 09:10:01 +0300 |
---|---|---|
committer | nodejh <jianghangscu@gmail.com> | 2021-08-16 09:10:01 +0300 |
commit | d334f480e2868c72e5ab3133c8ed79ffd796c8e2 (patch) | |
tree | 65d635998dcfda7f7d6f1db7e7257a785a84efd7 | |
parent | 23c428dcfbf7a49c46ca2bd6220198d2d1cbaea5 (diff) | |
parent | 09517fa3174076fb451704232018de2b651f8262 (diff) |
feat: support math block
-rw-r--r-- | layouts/partials/head.html | 6 | ||||
-rw-r--r-- | layouts/partials/math.html | 5 |
2 files changed, 9 insertions, 2 deletions
diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 79d9236..43cc32e 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -28,11 +28,13 @@ {{ template "_internal/google_analytics_async.html" . }} {{ end }} +{{ if or .Params.math .Site.Params.math }} + {{ partial "math.html" . }} +{{ end }} {{ if .OutputFormats.Get "RSS" }} {{ with .OutputFormats.Get "RSS" }} <link href="{{ .RelPermalink }}" rel="alternate" type="application/rss+xml" title="{{ $.Site.Title }}" /> <link href="{{ .RelPermalink }}" rel="feed" type="application/rss+xml" title="{{ $.Site.Title }}" /> {{ end }} -{{ end }} - +{{ end }}
\ No newline at end of file diff --git a/layouts/partials/math.html b/layouts/partials/math.html new file mode 100644 index 0000000..7c1279a --- /dev/null +++ b/layouts/partials/math.html @@ -0,0 +1,5 @@ +<!-- https://katex.org/docs/autorender.html --> +<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.13.13/dist/katex.min.css" integrity="sha384-RZU/ijkSsFbcmivfdRBQDtwuwVqK7GMOw6IMvKyeWL2K5UAlyp6WonmB8m7Jd0Hn" crossorigin="anonymous"> +<script defer src="https://cdn.jsdelivr.net/npm/katex@0.13.13/dist/katex.min.js" integrity="sha384-pK1WpvzWVBQiP0/GjnvRxV4mOb0oxFuyRxJlk6vVw146n3egcN5C925NCP7a7BY8" crossorigin="anonymous"></script> +<script defer src="https://cdn.jsdelivr.net/npm/katex@0.13.13/dist/contrib/auto-render.min.js" integrity="sha384-vZTG03m+2yp6N6BNi5iM4rW4oIwk5DfcNdFfxkk9ZWpDriOkXX8voJBFrAO7MpVl" crossorigin="anonymous" + onload="renderMathInElement(document.body);"></script>
\ No newline at end of file |