feat: global/individual toggle for KaTeX and copy button

Allow KaTeX and copy button to be enabled globally or for individual posts.
This commit is contained in:
welpo
2023-08-02 19:38:04 +02:00
parent 5cdc18e688
commit edcfa359ef
9 changed files with 42 additions and 42 deletions

View File

@@ -24,13 +24,13 @@
{% include "partials/footer.html" %}
{# Add KaTeX functionality (loads CSS and JS) #}
{%- if page.extra.katex and page.extra.katex == true -%}
{%- if config.extra.katex and config.extra.katex == true or page.extra.katex and page.extra.katex == true -%}
<link rel="stylesheet" href="{{ get_url(path='katex.min.css', trailing_slash=false) | safe }}">
<script defer src="{{ get_url(path='js/katex.min.js', trailing_slash=false) | safe }}"></script>
{%- endif -%}
{# Add copy button to codeblocks #}
{%- if config.extra.copy_button and config.extra.copy_button == true -%}
{%- if config.extra.copy_button and config.extra.copy_button == true or page.extra.copy_button and page.extra.copy_button == true -%}
<script defer src="{{ get_url(path='js/copyCodeToClipboard.min.js', trailing_slash=false) | safe }}"/></script>
{%- endif -%}