diff options
author | He Yeshuang <yeshuanghe@gmail.com> | 2020-05-10 16:54:32 +0300 |
---|---|---|
committer | He Yeshuang <yeshuanghe@gmail.com> | 2020-05-18 15:15:49 +0300 |
commit | 4fa45a0446c17974daec8a31ca60340620ac6003 (patch) | |
tree | 7701653a04fecbdc89755a47c8f27d854a7fc0d5 /layouts | |
parent | e110c3691ff1c1ecb1c11c9fa5f485b7182e5524 (diff) |
change the theme!
Diffstat (limited to 'layouts')
-rwxr-xr-x | layouts/_default/baseof.html | 3 | ||||
-rw-r--r-- | layouts/partials/math.html | 25 |
2 files changed, 28 insertions, 0 deletions
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 68a067d..e1e3774 100755 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -35,6 +35,9 @@ {{ if eq (getenv "HUGO_ENV") "production" | or (eq .Site.Params.env "production") }} {{ template "_internal/google_analytics_async.html" . }} {{ end }} + {{ if or .Params.math .Site.Params.math }} + {{ partial "math.html" . }} + {{ end }} </head> <body class="bg-gray-100 text-gray-700"> diff --git a/layouts/partials/math.html b/layouts/partials/math.html new file mode 100644 index 0000000..dd18e01 --- /dev/null +++ b/layouts/partials/math.html @@ -0,0 +1,25 @@ +<!-- KaTeX (as in HugoBasicExample) --> +<!-- to update Katex check out https://github.com/KaTeX/KaTeX --> + +<!-- Katex css --> +<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.css" integrity="sha384-zB1R0rpPzHqg7Kpt0Aljp8JPLqbXI3bhnPWROx27a9N0Ll6ZP/+DiW/UqRcLbRjq" crossorigin="anonymous"> + +<!-- The loading of KaTeX is deferred to speed up page rendering --> +<script defer src="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.js" integrity="sha384-y23I5Q6l+B6vatafAwxRu/0oK/79VlbSz7Q9aiSZUvyWYIYsd+qj+o24G5ZU2zJz" crossorigin="anonymous"></script> + +<!-- To automatically render math in text elements, include the auto-render extension: --> +<script defer src="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/contrib/auto-render.min.js" integrity="sha384-kWPLUVMOks5AQFrykwIup5lo0m3iMkkHrD0uJ4H5cjeGihAutqP0yW0J6dpFiVkI" +crossorigin="anonymous" +onload='renderMathInElement(document.body);'></script> + + +<script> + document.addEventListener("DOMContentLoaded", function() { + renderMathInElement(document.body, { + delimiters: [ + {left: "$$", right: "$$", display: true}, + {left: "$", right: "$", display: false} + ] + }); + }); +</script> |