mirror of
https://github.com/13hannes11/hugo-coder-timeline.git
synced 2024-09-04 00:50:58 +02:00
* MathJax support There was no support for displaying math written in Latex. This is now added with the help of MathJax. MathJax uses an external Javascript file and as not to add unnecessary load the support for math is only enabled if the 'math' param is set to true. * MathJax support There was no support for displaying math written in Latex. This is now added with the help of MathJax. MathJax uses an external Javascript file and as not to add unnecessary load the support for math is only enabled if the 'math' param is set to true. * Auto stash before merge of "math" and "origin/math" * Delete unnecessary option * Actually enable math for demo page * Have demo page be consistent
36 lines
1.3 KiB
HTML
36 lines
1.3 KiB
HTML
<section class="container post">
|
|
<article>
|
|
<header>
|
|
<h1 class="title">{{ .Title }}</h1>
|
|
<h2 class="date">{{ .Date.Format "January 2, 2006" }}</h2>
|
|
|
|
{{ if eq .Params.math "true" }}
|
|
<script type="text/javascript" async
|
|
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js?config=TeX-AMS-MML_HTMLorMML-full">
|
|
MathJax.Hub.Config({
|
|
tex2jax: {
|
|
inlineMath: [['$','$']],
|
|
displayMath: [['$$','$$']],
|
|
processEscapes: true,
|
|
processEnvironments: true,
|
|
skipTags: ['script', 'noscript', 'style', 'textarea', 'pre'],
|
|
TeX: { extensions: ["AMSmath.js", "AMSsymbols.js"] }
|
|
}
|
|
});
|
|
MathJax.Hub.Queue(function() {
|
|
// Fix <code> tags after MathJax finishes running. This is a
|
|
// hack to overcome a shortcoming of Markdown. Discussion at
|
|
// https://github.com/mojombo/jekyll/issues/199
|
|
var all = MathJax.Hub.getAllJax(), i;
|
|
for(i = 0; i < all.length; i += 1) {
|
|
all[i].SourceElement().parentNode.className += ' has-jax';
|
|
}
|
|
});
|
|
</script>
|
|
{{ end }}
|
|
</header>
|
|
|
|
{{ .Content }}
|
|
</article>
|
|
</section>
|