Skip to content
This repository has been archived by the owner on Apr 23, 2022. It is now read-only.
/ hugo-mod-mathjax Public archive

MathJax packaged as a Hugo Module.

License

Notifications You must be signed in to change notification settings

peaceiris/hugo-mod-mathjax

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hugo-mod-mathjax

MathJax packaged as a Hugo Module (Hugo Modules).

Usage

config/_default/config.yaml

module:
  imports:
    - path: github.com/peaceiris/hugo-mod-mathjax

In a Hugo template file.

<script defer>
  MathJax = {
    tex: {
      inlineMath: [['$', '$'], ['\\(', '\\)']]
    }
  };
</script>

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