Add initial MathJax support

This commit is contained in:
vimux 2018-05-27 14:59:18 +03:00
parent 5cb9c55085
commit 5c6983ec9e
No known key found for this signature in database
GPG key ID: 5A34FDC4EE832E34
3 changed files with 9 additions and 2 deletions

View file

@ -32,10 +32,13 @@ description = "John Doe's Personal blog about everything" # Description of your
opengraph = true # Enable OpenGraph if true opengraph = true # Enable OpenGraph if true
twitter_cards = true # Enable Twitter Cards if true twitter_cards = true # Enable Twitter Cards if true
cardsPerRow = 2 # Possible values: 1, 2, 3 cardsPerRow = 2 # Possible values: 1, 2, 3
#toc: true # Enable Table of Contents for all site pages
#comments: true # Enable comments for all site pages
#mainSections = ["post"] # Set main page sections #mainSections = ["post"] # Set main page sections
#dateFormat = "2006-01-02" # change the format of dates #dateFormat = "2006-01-02" # change the format of dates
#toc: true # Enable Table of Contents for all site pages
#comments: true # Enable comments for all site pages
#mathjax: true # Enable MathJax for all site pages
#mathjaxPath: "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js" # Specify path to MathJax lib. Optional
#mathjaxConfig: "TeX-AMS-MML_HTMLorMML" # Specify MathJax config. Optional
[Params.Social] [Params.Social]
#facebook = "username" #facebook = "username"

View file

@ -4,5 +4,6 @@
</footer> </footer>
<script src="{{ "js/modernizr.js" | relURL }}"></script> <script src="{{ "js/modernizr.js" | relURL }}"></script>
<script src="{{ "js/menu.js" | relURL }}"></script> <script src="{{ "js/menu.js" | relURL }}"></script>
{{- partial "mathjax.html" . -}}
</body> </body>
</html> </html>

View file

@ -0,0 +1,3 @@
{{ if and .IsPage (eq (.Param "mathjax") true) }}
<script src="{{ .Param "mathjaxPath" | default "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js" }}{{ with .Param "mathjaxConfig" | default "TeX-AMS-MML_HTMLorMML" }}?config={{ . }}{{ end }}" async></script>
{{ end }}