Skip to content

Commit

Permalink
preload katex fonts
Browse files Browse the repository at this point in the history
  • Loading branch information
HidegonSan committed Nov 28, 2023
1 parent 658884a commit 3f00d63
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions layouts/partials/head/katex.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@

{{- if or (.Params.katex) (.Params.mhchem) (.HasShortcode "katex") -}}

<link crossorigin="anonymous" href={{- "assets/css/fonts/KaTeX_Main-Regular.woff2" | relURL }} rel="preload" as="font" type="font/woff2">
<link crossorigin="anonymous" href={{- "assets/css/fonts/KaTeX_Math-Italic.woff2" | relURL }} rel="preload" as="font" type="font/woff2">
<link crossorigin="anonymous" href={{- "assets/css/fonts/KaTeX_Size2-Regular.woff2" | relURL }} rel="preload" as="font" type="font/woff2" >

{{- $katex_license_body := "/*\nSPDX-License-Identifier: MIT\nLicensed under the MIT license.\nhttps://github.com/KaTeX/KaTeX/blob/main/LICENSE\nhttps://opensource.org/license/mit/\n*/\n" -}}
{{- $katex_license_css := $katex_license_body | resources.FromString "css/katex_license.css" -}}
{{- $katex_license_js := $katex_license_body | resources.FromString "js/katex_license.js" -}}
Expand Down

0 comments on commit 3f00d63

Please sign in to comment.