Skip to content

Commit f61ce38

Browse files
committed
Enable Math Markdown Rendering Support
Signed-off-by: Steve Scargall <[email protected]>
1 parent 2ec37ec commit f61ce38

File tree

3 files changed

+29
-1
lines changed

3 files changed

+29
-1
lines changed

hugo.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,24 @@ authors = 'authors'
3030
categories = 'categories'
3131
tags = 'tags'
3232

33+
[markup]
34+
[markup.goldmark]
35+
[markup.goldmark.extensions]
36+
[markup.goldmark.extensions.passthrough]
37+
enable = true
38+
[markup.goldmark.extensions.passthrough.delimiters]
39+
block = [['\[', '\]'], ['$$', '$$']]
40+
inline = [['\(', '\)']]
41+
3342
[params]
3443
description = "MemMachine is an open-source memory layer for advanced AI agents. It enables AI to learn, store, and recall data and preferences from past interactions, creating sophisticated, personalized user profiles."
3544

3645
# Your Google Analytics ID (e.g., "G-XXXXXXXXXX")
3746
googleAnalytics = "G-G0GZQH4153"
3847

48+
# Enable Math Markdown
49+
math = true
50+
3951
[params.social]
4052
discord = "https://discord.gg/usydANvKqD"
4153
twitter = "https://x.com/your-twitter-handle"

themes/memmachine/layouts/_partials/head.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,8 @@
2020
<!-- SEO Metadata -->
2121
{{ partial "head/seo-metadata.html" . }}
2222
<!-- Analytics -->
23-
{{ partial "head/analytics.html" . }}
23+
{{ partial "head/analytics.html" . }}
24+
25+
{{ if .Param "math" }}
26+
{{ partialCached "math.html" . }}
27+
{{ end }}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"></script>
2+
<script>
3+
MathJax = {
4+
tex: {
5+
displayMath: [['\\[', '\\]'], ['$$', '$$']], // block
6+
inlineMath: [['\\(', '\\)']] // inline
7+
},
8+
loader:{
9+
load: ['ui/safe']
10+
},
11+
};
12+
</script>

0 commit comments

Comments
 (0)