Skip to content

Commit

Permalink
Fix #126 -- add KaTeX css to hyde theme
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Jul 17, 2017
1 parent 103ca95 commit 85728c7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 22 deletions.
4 changes: 3 additions & 1 deletion v7/hyde/templates/index.tmpl
@@ -1,5 +1,6 @@
{# -*- coding: utf-8 -*- #}
{% import 'index_helper.tmpl' as helper with context %}
{% import 'math_helper.tmpl' as math with context %}
{% import 'comments_helper.tmpl' as comments with context %}
{% extends 'base.tmpl' %}

Expand All @@ -8,6 +9,7 @@
{% if posts and (permalink == '/' or permalink == '/' + index_file) %}
<link rel="prefetch" href="{{ posts[0].permalink() }}" type="text/html">
{% endif %}
{{ math.math_styles_ifposts(posts) }}
{% endblock %}

{% block content %}
Expand Down Expand Up @@ -37,5 +39,5 @@
</div>
{{ helper.html_pager() }}
{{ comments.comment_link_script() }}
{{ helper.mathjax_script(posts) }}
{{ math.math_scripts_ifposts(posts) }}
{% endblock %}
21 changes: 0 additions & 21 deletions v7/hyde/templates/post_helper.tmpl
Expand Up @@ -94,24 +94,3 @@
{% endif %}
{% endif %}
{% endmacro %}

{% macro mathjax_script(post) %}
{% if post.is_mathjax %}
{% if use_katex %}
<script src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.5.1/katex.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.5.1/contrib/auto-render.min.js"></script>
<script>
renderMathInElement(document.body);
</script>
{% else %}
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"> </script>
{% if mathjax_config %}
{{ mathjax_config }}
{% else %}
<script type="text/x-mathjax-config">
MathJax.Hub.Config({tex2jax: {inlineMath: [['$latex ','$'], ['\\(','\\)']]}});
</script>
{% endif %}
{% endif %}
{% endif %}
{% endmacro %}

0 comments on commit 85728c7

Please sign in to comment.