Skip to content

Commit 081ec35

Browse files
L4Phsaicaca
authored andcommitted
feat: self-host KaTeX CSS (saicaca#279)
1 parent baa8941 commit 081ec35

File tree

3 files changed

+85
-63
lines changed

3 files changed

+85
-63
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"astro-compress": "^2.3.5",
3535
"astro-icon": "^1.1.1",
3636
"hastscript": "^9.0.0",
37+
"katex": "^0.16.19",
3738
"markdown-it": "^14.1.0",
3839
"mdast-util-to-string": "^4.0.0",
3940
"overlayscrollbars": "^2.10.0",

pnpm-lock.yaml

Lines changed: 80 additions & 58 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/layouts/Layout.astro

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,18 @@ import { profileConfig, siteConfig } from '@/config'
77
import ConfigCarrier from '@components/ConfigCarrier.astro'
88
import {
99
AUTO_MODE,
10-
DARK_MODE,
11-
DEFAULT_THEME,
12-
LIGHT_MODE,
1310
BANNER_HEIGHT,
1411
BANNER_HEIGHT_EXTEND,
1512
BANNER_HEIGHT_HOME,
13+
DARK_MODE,
14+
DEFAULT_THEME,
15+
LIGHT_MODE,
1616
PAGE_WIDTH,
1717
} from '../constants/constants'
1818
import { defaultFavicons } from '../constants/icon'
1919
import type { Favicon } from '../types/config'
2020
import { url, pathsEqual } from '../utils/url-utils'
21+
import 'katex/dist/katex.css'
2122
2223
interface Props {
2324
title?: string
@@ -144,8 +145,6 @@ const bannerOffset =
144145

145146
<slot name="head"></slot>
146147

147-
<link rel="stylesheet" href="https://cdn.staticfile.net/KaTeX/0.16.9/katex.min.css" integrity="sha384-n8MVd4RsNIU0tAv4ct0nTaAbDJwPJzDEaqSD1odI+WdtXRGWt2kTvGFasHpSy3SV" crossorigin="anonymous">
148-
149148
<link rel="alternate" type="application/rss+xml" title={profileConfig.name} href={`${Astro.site}rss.xml`}/>
150149

151150
</head>

0 commit comments

Comments
 (0)