Skip to content

Commit

Permalink
feat: Add MathJax
Browse files Browse the repository at this point in the history
  • Loading branch information
peaceiris committed Feb 3, 2020
1 parent baa4c9e commit 78340ba
Show file tree
Hide file tree
Showing 32 changed files with 73 additions and 4 deletions.
1 change: 1 addition & 0 deletions exampleSite/assets/js/mathjax-v3.0.0-tex-mml-chtml.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions exampleSite/assets/js/mathjax-v3.0.0-tex-svg.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ publishdate: 2019-11-01T01:00:00.000Z
eyecatch: images/github-pages-and-github-actions.jpg
# tags: ["GitHub Actions"]
toc: true
# mathjax: true
# math: true
# mermaid: true
# weight: 1
twitter:
Expand Down
2 changes: 1 addition & 1 deletion exampleSite/content/en/posts/lighthouse-github-actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ publishdate: 2019-10-01T01:00:00.000Z
eyecatch: images/lighthouse-github-actions.jpg
# tags: ["GitHub Actions"]
# toc: true
# mathjax: true
# math: true
# mermaid: true
# weight: 1
twitter:
Expand Down
53 changes: 53 additions & 0 deletions exampleSite/content/en/posts/mathjax.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
title: MathJax Support
description: Beautiful math in all browsers
publishdate: 2020-01-01T01:00:00.000Z
# draft: true
# eyecatch: images/mathjax.jpg
# tags: ["hugo"]
toc: true
math: true
# mermaid: true
# weight: 1
twitter:
username: piris314
hashtags: ["hugo"]
---



## MathJax

[mathjax/MathJax: Beautiful math in all browsers](https://github.com/mathjax/MathJax)



## Inline Example

### Input

```tex
Inline $E = mc^2$
```

### Output

Inline $E = mc^2$



## Basic Example

### Input

```tex
$$
\sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6}
$$
```

### Output

$$
\sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6}
$$
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ publishdate: 2019-11-01T01:00:00.000Z
eyecatch: images/github-pages-and-github-actions.jpg
# tags: ["GitHub Actions"]
toc: true
# mathjax: true
# math: true
# mermaid: true
# weight: 1
twitter:
Expand Down
2 changes: 1 addition & 1 deletion exampleSite/content/ja/posts/lighthouse-github-actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ publishdate: 2019-10-01T01:00:00.000Z
eyecatch: images/lighthouse-github-actions.jpg
# tags: ["GitHub Actions"]
# toc: true
# mathjax: true
# math: true
# mermaid: true
# weight: 1
twitter:
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions layouts/_default/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
</div>
</section>
{{ partial "footer" . }}
{{ partial "mathjax" . }}
</body>
</html>
13 changes: 13 additions & 0 deletions layouts/partials/mathjax.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{ with $.Params.math }}
<script>
MathJax = {
tex: {
inlineMath: [['$', '$'], ['\\(', '\\)']]
}
};
</script>

{{ $js := resources.Get "js/mathjax-v3.0.0-tex-mml-chtml.js" }}
{{ $secureJS := $js | resources.Fingerprint "sha512" }}
<script async type="text/javascript" id="MathJax-script" src="{{ $secureJS.Permalink }}" integrity="{{ $secureJS.Data.Integrity }}"></script>
{{ end }}

0 comments on commit 78340ba

Please sign in to comment.