Add Katex support for displaying math

This commit is contained in:
Maxime LETEMPLE
2024-08-27 18:39:48 +02:00
parent 5c80cfeca4
commit 371a86092b
4 changed files with 18791 additions and 0 deletions

View File

@ -9,6 +9,22 @@
{%- endif %}
<title>{% include "partials/title.html" %}</title>
<link rel="canonical" href="{{ current_url | default(value='/') | safe }}" />
{%- if config.extra.katex %}
<link rel="stylesheet" href="{{ get_url(path="katex.css") }}">
<script defer src="{{ get_url(path="katex.js")}}"></script>
<script defer src="{{ get_url(path="auto-render.js") }}"></script>
<script>
document.addEventListener("DOMContentLoaded", function() {
renderMathInElement(document.body, {
delimiters: [
{left: "$$", right: "$$", display: true},
{left: "$", right: "$", display: false},
]
});
});
</script>
{%- endif %}
{%- if config.markdown.highlight_code and config.markdown.highlight_theme == "css" %}
{%- if config.markdown.highlight_themes_css | length > 0 %}