Skip to content
Permalink
Browse files

Fix #126 -- add KaTeX css to hyde theme

Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Jul 17, 2017
1 parent 103ca95 commit 85728c7f1fae18fc3df3eb149a7cedecf9fa3ae0
Showing with 3 additions and 22 deletions.
  1. +3 −1 v7/hyde/templates/index.tmpl
  2. +0 −21 v7/hyde/templates/post_helper.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' %}

@@ -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 %}
@@ -37,5 +39,5 @@
</div>
{{ helper.html_pager() }}
{{ comments.comment_link_script() }}
{{ helper.mathjax_script(posts) }}
{{ math.math_scripts_ifposts(posts) }}
{% endblock %}
@@ -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.