Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add configurable KaTeX location #224

Merged
merged 2 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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)

# giscus
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