From a7b8f21839542f524011165deb31536b73333fe3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Sko=C5=99epa?= <jakub@skorepa.info> Date: Mon, 11 Apr 2016 15:57:53 +0200 Subject: [PATCH] MathJax Implements #26 --- theme/templates/article.html.nunj | 28 +++++++++++++++++++++++++ theme/templates/partials/base.html.nunj | 3 ++- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/theme/templates/article.html.nunj b/theme/templates/article.html.nunj index bf6f74db..ae611c97 100644 --- a/theme/templates/article.html.nunj +++ b/theme/templates/article.html.nunj @@ -1,5 +1,33 @@ {% extends "partials/base.html.nunj" %} +{% block head %} +{{ super() }} +{{ metadata.headerextra | safe }} +<script type="text/x-mathjax-config"> + MathJax.Hub.Config({ + extensions: ["tex2jax.js"], + jax: ["input/TeX", "output/HTML-CSS"], + tex2jax: { + inlineMath: [ ['$','$'], ["\\(","\\)"] ], + displayMath: [ ['$$','$$'], ["\\[","\\]"] ], + processEscapes: true + }, + elements: $("#content article"), + "HTML-CSS": { availableFonts: ["TeX"] }, + locale: "cs", + menuSettings: { + zoom: "Hover" + }, + MathEvents: { + hover: 0 + } + }); +</script> +<script type="text/javascript" async + src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_CHTML&"> +</script> +{% endblock %} + {% block bodyattr %} class="type-article"{% endblock %} {% block content %} diff --git a/theme/templates/partials/base.html.nunj b/theme/templates/partials/base.html.nunj index 113d4536..a7715304 100644 --- a/theme/templates/partials/base.html.nunj +++ b/theme/templates/partials/base.html.nunj @@ -1,6 +1,7 @@ <!DOCTYPE html> <html lang="en"> <head> +{% block head %} <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0"/> <title>{% if metadata.title %}{{ metadata.title }}{%else%}Radioklub OK1KVK{%endif%}</title> @@ -35,7 +36,7 @@ {% if config.devel %} <script src="{{ config.baseurl }}/theme/js/socket.io-1.4.5.js"></script> {% endif %} - {{ metadata.headerextra | safe }} +{% endblock %} </head> <body{% block bodyattr %}{% endblock %}> {% import "partials/svgs.html.nunj" as svgs %} -- GitLab