From 0374aa92bf728d91882939538a11def42da9865f Mon Sep 17 00:00:00 2001 From: Hanwen Guo Date: Fri, 26 Aug 2022 17:51:29 +0800 Subject: [PATCH] Add mathjax support --- assets/css/main.scss | 9 ++++++++- layouts/partials/head.html | 3 ++- layouts/partials/mathjax.html | 21 +++++++++++++++++++++ 3 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 layouts/partials/mathjax.html diff --git a/assets/css/main.scss b/assets/css/main.scss index 2f98744..a1587db 100644 --- a/assets/css/main.scss +++ b/assets/css/main.scss @@ -76,6 +76,13 @@ code { background: black; } +code.has-jax { + -webkit-font-smoothing: antialiased; + background: inherit !important; + border: none !important; + font-size: 100%; +} + blockquote { font-style: italic; border: thin solid black; @@ -88,4 +95,4 @@ img { max-width: 100%; display: block; margin: 0 auto; -} \ No newline at end of file +} diff --git a/layouts/partials/head.html b/layouts/partials/head.html index de4f6c1..4faa036 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -17,4 +17,5 @@ {{ $sass := resources.Get "css/main.scss" }} {{ $style := $sass | resources.ToCSS $options }} - \ No newline at end of file + {{ if .Params.mathjax }} {{ partial "mathjax.html" . }} {{ end }} + diff --git a/layouts/partials/mathjax.html b/layouts/partials/mathjax.html new file mode 100644 index 0000000..496994b --- /dev/null +++ b/layouts/partials/mathjax.html @@ -0,0 +1,21 @@ + + +