jk.nipponalba.scot website https://jk.nipponalba.scot
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

29 lines
1.7 KiB

5 years ago
  1. {{- if or (eq site.Params.math true) (eq .Params.math true) -}}
  2. {{- $use := "katex" -}}
  3. {{- with site.Params.math -}}
  4. {{- if and (isset . "use") (eq (.use | lower) "mathjax") -}}
  5. {{- $use = "mathjax" -}}
  6. {{- end -}}
  7. {{- end -}}
  8. {{- if eq $use "mathjax" -}}
  9. {{- $url := "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-AMS-MML_HTMLorMML" -}}
  10. {{- $hash := "sha384-e/4/LvThKH1gwzXhdbY2AsjR3rm7LHWyhIG5C0jiRfn8AN2eTN5ILeztWw0H9jmN" -}}
  11. <script defer type="text/javascript" src="{{- $url -}}" integrity="{{- $hash -}}" crossorigin="anonymous"></script>
  12. <script
  13. type="text/x-mathjax-config">MathJax.Hub.Config({ tex2jax: { inlineMath: [['$','$'], ['\\(','\\)']] } });</script>
  14. {{- else -}}
  15. {{- $url := "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.css" -}}
  16. {{- $hash := "sha384-zB1R0rpPzHqg7Kpt0Aljp8JPLqbXI3bhnPWROx27a9N0Ll6ZP/+DiW/UqRcLbRjq" -}}
  17. <link rel="stylesheet" href="{{- $url -}}" integrity="{{- $hash -}}" crossorigin="anonymous">
  18. {{- $url := "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.js" -}}
  19. {{- $hash := "sha384-y23I5Q6l+B6vatafAwxRu/0oK/79VlbSz7Q9aiSZUvyWYIYsd+qj+o24G5ZU2zJz" -}}
  20. <script defer src="{{- $url -}}" integrity="{{- $hash -}}" crossorigin="anonymous"></script>
  21. {{- $url := "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/contrib/auto-render.min.js" -}}
  22. {{- $hash := "sha384-kWPLUVMOks5AQFrykwIup5lo0m3iMkkHrD0uJ4H5cjeGihAutqP0yW0J6dpFiVkI" -}}
  23. <script defer src="{{- $url -}}" integrity="{{- $hash -}}" crossorigin="anonymous"
  24. onload="renderMathInElement(document.body);"></script>
  25. {{- end -}}
  26. {{- end -}}