From 0f2bd0c0a61042166a81badec1c00fd1cfda4261 Mon Sep 17 00:00:00 2001 From: Vlad Ionescu Date: Tue, 1 May 2018 20:48:49 +0200 Subject: [PATCH] Math (#14) * 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 --- exampleSite/content/posts/theme-demo.md | 7 +++++++ layouts/partials/post.html | 25 +++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/exampleSite/content/posts/theme-demo.md b/exampleSite/content/posts/theme-demo.md index f11b5b7..39c8c69 100644 --- a/exampleSite/content/posts/theme-demo.md +++ b/exampleSite/content/posts/theme-demo.md @@ -1,6 +1,7 @@ +++ date = "2017-01-08" title = "Theme Demo" +math = "true" +++ @@ -26,6 +27,12 @@ _This is italic text_ ~~Deleted text~~ +This is text with inline math $\sum_{n=1}^{\infty} 2^{-n} = 1$ and with math blocks: + +$$ +\sum_{n=1}^{\infty} 2^{-n} = 1 +$$ + | Heading | Another heading | | :----: | :-------------: | | text | text | diff --git a/layouts/partials/post.html b/layouts/partials/post.html index 5e8e4dd..b32ccd9 100644 --- a/layouts/partials/post.html +++ b/layouts/partials/post.html @@ -3,6 +3,31 @@

{{ .Title }}

{{ .Date.Format "January 2, 2006" }}

+ + {{ if eq .Params.math "true" }} + + {{ end }}
{{ .Content }}