Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zwbetz-gh/vanilla-bootstrap-hugo-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzwbetz-gh <37317628+zwbetz-gh@users.noreply.github.com>2020-02-29 06:01:01 +0300
committerGitHub <noreply@github.com>2020-02-29 06:01:01 +0300
commitc9a46a20de130af8a38a755857fcade56e1028cc (patch)
treee4326f45303a4d7431e98cc63669fc0bf2698892 /layouts
parent92eaa26a8e76edb065de4e01619d1c30e9bb1fe0 (diff)
add katex support (#17)
Diffstat (limited to 'layouts')
-rw-r--r--layouts/_default/baseof.html1
-rw-r--r--layouts/partials/katex.html27
2 files changed, 28 insertions, 0 deletions
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
index 7d81159..83873bd 100644
--- a/layouts/_default/baseof.html
+++ b/layouts/_default/baseof.html
@@ -11,6 +11,7 @@
</div>
{{ partial "footer.html" . }}
{{ partial "script.html" . }}
+ {{ partial "katex.html" . }}
{{ partial "google-analytics-async.html" . }}
</body>
</html> \ No newline at end of file
diff --git a/layouts/partials/katex.html b/layouts/partials/katex.html
new file mode 100644
index 0000000..b7e5989
--- /dev/null
+++ b/layouts/partials/katex.html
@@ -0,0 +1,27 @@
+<!-- https://katex.org/docs/browser.html -->
+
+{{ if eq site.Params.katex true }}
+<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>
+{{ end }}