feat: add copy button to code blocks

This commit is contained in:
welpo
2023-07-07 22:03:47 +02:00
parent f710b62631
commit 2dec139e41
13 changed files with 190 additions and 112 deletions

View File

@@ -22,11 +22,16 @@
</div>
{% include "partials/footer.html" %}
{% if page.extra.katex and page.extra.katex == true %}
{# Add KaTeX functionality (loads CSS and JS) #}
{%- if 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 %}
{%- endif -%}
{# Add copy button to codeblocks #}
{%- if config.extra.copy_button and config.extra.copy_button == true -%}
<script defer src="{{ get_url(path='js/copyCodeToClipboard_min.js', trailing_slash=false) | safe }}"/></script>
{%- endif -%}
</body>
</html>