mirror of
https://github.com/tcsenpai/obsidiangarden_netlify.git
synced 2025-06-07 05:05:20 +00:00
Add support for inline mathjax
This commit is contained in:
parent
795b6250db
commit
6d39919a3f
@ -82,8 +82,8 @@ module.exports = function(eleventyConfig) {
|
|||||||
|
|
||||||
eleventyConfig.addTransform('link', function(str) {
|
eleventyConfig.addTransform('link', function(str) {
|
||||||
return str && str.replace(/\[\[(.*?)\]\]/g, function(match, p1) {
|
return str && str.replace(/\[\[(.*?)\]\]/g, function(match, p1) {
|
||||||
//Check if it is an embedded excalidraw drawing
|
//Check if it is an embedded excalidraw drawing or mathjax javascript
|
||||||
if(p1.indexOf("],[") > -1){
|
if (p1.indexOf(",") > -1) {
|
||||||
return match;
|
return match;
|
||||||
}
|
}
|
||||||
const [fileName, linkTitle] = p1.split("|");
|
const [fileName, linkTitle] = p1.split("|");
|
||||||
@ -124,4 +124,4 @@ module.exports = function(eleventyConfig) {
|
|||||||
passthroughFileCopy: true,
|
passthroughFileCopy: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
@ -10,7 +10,14 @@
|
|||||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.25.0/themes/prism-okaidia.min.css" integrity="sha512-mIs9kKbaw6JZFfSuo+MovjU+Ntggfoj8RwAmJbVXQ5mkAX5LlgETQEweFPI18humSPHymTb5iikEOKWF7I8ncQ==" crossorigin="anonymous" referrerpolicy="no-referrer"/>
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.25.0/themes/prism-okaidia.min.css" integrity="sha512-mIs9kKbaw6JZFfSuo+MovjU+Ntggfoj8RwAmJbVXQ5mkAX5LlgETQEweFPI18humSPHymTb5iikEOKWF7I8ncQ==" crossorigin="anonymous" referrerpolicy="no-referrer"/>
|
||||||
|
|
||||||
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
|
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
|
||||||
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
|
<script>
|
||||||
|
MathJax = {
|
||||||
|
tex: {
|
||||||
|
inlineMath: [["$", "$"]]
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"></script>
|
||||||
|
|
||||||
<link href="/styles/style.css" rel="stylesheet">
|
<link href="/styles/style.css" rel="stylesheet">
|
||||||
<link href="/styles/custom-style.css" rel="stylesheet">
|
<link href="/styles/custom-style.css" rel="stylesheet">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user