feat: Adds math-jax support for latex equations, updates gitignore
This commit is contained in:
@@ -103,5 +103,6 @@ private func generateHeader(_ pageTitle: String, _ extraHeader: NodeConvertible)
|
||||
link(href: "/static/style.css", rel: "stylesheet")
|
||||
link(href: "/articles/feed.xml", rel: "alternate", title: SiteMetadata.name, type: "application/rss+xml")
|
||||
extraHeader
|
||||
script(src: "https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,6 +50,19 @@ func getArticleHeader(_ article: Item<ArticleMetadata>) -> NodeConvertible {
|
||||
meta(content: "1014", name: "og:image:width")
|
||||
meta(content: "530", name: "og:image:height")
|
||||
script(crossorigin: "anonymous", src: "https://kit.fontawesome.com/f209982030.js")
|
||||
Node.raw("""
|
||||
<script>
|
||||
MathJax = {
|
||||
tex: {
|
||||
inlineMath: [['$', '$'], ['\\(', '\\)']]
|
||||
},
|
||||
svg: {
|
||||
fontCache: 'global'
|
||||
}
|
||||
};
|
||||
</script>
|
||||
""")
|
||||
script(defer: true, src: "https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js")
|
||||
}
|
||||
|
||||
func renderArticle(context: ItemRenderingContext<ArticleMetadata>) -> Node {
|
||||
|
||||
Reference in New Issue
Block a user