Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/humrochagf/colordrop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHumberto Rocha <humrochagf@gmail.com>2019-09-04 16:31:13 +0300
committerHumberto Rocha <humrochagf@gmail.com>2019-09-04 16:31:13 +0300
commit685e22a1631dec5b8f6d8a5bf1d2c3766951f3db (patch)
treeb4ebbe7d02d39998b7519860e8e4a167fcbf8b0a /layouts
parent984c90a88ac827f208158c978462a70304f448a1 (diff)
Add katex support
Diffstat (limited to 'layouts')
-rw-r--r--layouts/_default/baseof.html6
-rw-r--r--layouts/blog/single.html6
-rw-r--r--layouts/partials/katex.html7
3 files changed, 19 insertions, 0 deletions
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
index b4bee90..8fffebc 100644
--- a/layouts/_default/baseof.html
+++ b/layouts/_default/baseof.html
@@ -12,6 +12,9 @@
<!-- styles -->
{{ $style := resources.Get "sass/main.scss" | resources.ExecuteAsTemplate "style.main.scss" . | resources.ToCSS | resources.Minify | resources.Fingerprint }}
<link rel="stylesheet" href="{{ $style.Permalink }}">
+
+ {{ block "headAdditional" . }}
+ {{ end }}
</head>
<body class="{{ block "bodyClass" . }}{{ end }}">
@@ -33,5 +36,8 @@
{{ end }}
{{ partial "addthis" . }}
+
+ {{ block "footerJS" . }}
+ {{ end }}
</body>
</html>
diff --git a/layouts/blog/single.html b/layouts/blog/single.html
index 2d4e97c..d0d769c 100644
--- a/layouts/blog/single.html
+++ b/layouts/blog/single.html
@@ -4,6 +4,12 @@
</script>
{{ end }}
+{{ define "headAdditional" }}
+ {{ if .Params.katex }}
+ {{ partial "katex" . }}
+ {{ end }}
+{{ end }}
+
{{ define "main" }}
<article>
<h1 class="title">{{ .Title }}</h1>
diff --git a/layouts/partials/katex.html b/layouts/partials/katex.html
new file mode 100644
index 0000000..63dd5c1
--- /dev/null
+++ b/layouts/partials/katex.html
@@ -0,0 +1,7 @@
+<link rel="stylesheet" href="{{ "katex/katex.min.css" | absURL }}">
+
+<!-- The loading of KaTeX is deferred to speed up page rendering -->
+<script defer src="{{ "katex/katex.min.js" | absURL }}"></script>
+
+<!-- To automatically render math in text elements, include the auto-render extension: -->
+<script defer src="{{ "katex/contrib/auto-render.min.js" | absURL }}" onload="renderMathInElement(document.body);"></script>