Skip to content

Commit

Permalink
Merge pull request #224 from jemos/local-katex-param
Browse files Browse the repository at this point in the history
Add configurable KaTeX location
  • Loading branch information
nanxiaobei committed May 13, 2024
2 parents dd67746 + 708f3e8 commit 90059f7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ disqusShortname = 'YOUR_DISQUS_SHORTNAME' # use disqus comments
monoDarkIcon = true # show monochrome dark mode icon
gravatarCdn = 'GRAVATAR_CDN_LINK' # e.g. 'https://cdn.v2ex.com/gravatar/'
math = true # enable KaTeX math typesetting globally
localKatex = false # use local KaTeX js/css instead of CDN
graphCommentId = "YOUR_GRAPH_COMMENT_ID" # use graph comment (disqus alternative)
favicon = "favicon.ico" # customize the default favicon
appleTouchIcon = "apple-touch-icon.png" # customize the default Apple touch icon
Expand Down
6 changes: 6 additions & 0 deletions layouts/partials/math.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
{{ if site.Params.localKatex }}
<link rel="stylesheet" href="{{ "katex.min.css" | relURL }}"/>
<script defer src="{{ "katex.min.js" | relURL }}"></script>
<script defer src="{{ "auto-render.min.js" | relURL }}"></script>
{{ else }}
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/katex@0.16.7/dist/katex.min.css"
Expand All @@ -16,6 +21,7 @@
integrity="sha384-+VBxd3r6XgURycqtZ117nYw44OOcIax56Z4dCRWbxyPt0Koah1uHoK0o4+/RRE05"
crossorigin="anonymous"
></script>
{{ end }}

<script>
document.addEventListener('DOMContentLoaded', () =>
Expand Down

0 comments on commit 90059f7

Please sign in to comment.