Skip to content

Commit fcc9d99

Browse files
committedDec 12, 2023
docs: add two blog
Signed-off-by: laixingyou <[email protected]>
1 parent f69f863 commit fcc9d99

File tree

5 files changed

+82
-6
lines changed

5 files changed

+82
-6
lines changed
 

‎docusaurus.config.js

+15
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
const lightCodeTheme = require('prism-react-renderer/themes/github');
55
const darkCodeTheme = require('prism-react-renderer/themes/dracula');
6+
const math = require('remark-math');
7+
const katex = require('rehype-katex');
68

79
const vercel = process.env.VERCEL_ENV === 'preview';
810

@@ -38,6 +40,8 @@ const config = {
3840
path: 'modules',
3941
routeBasePath: 'docs',
4042
exclude: ['**/blog/**'],
43+
remarkPlugins: [math],
44+
rehypePlugins: [katex],
4145
sidebarPath: require.resolve('./sidebars.js'),
4246
// Please change this to your repo.
4347
// Remove this to remove the "edit this page" links.
@@ -59,6 +63,8 @@ const config = {
5963
routeBasePath: 'blog',
6064
showReadingTime: false,
6165
blogSidebarCount: 'ALL',
66+
remarkPlugins: [math],
67+
rehypePlugins: [katex],
6268
// Please change this to your repo.
6369
// Remove this to remove the "edit this page" links.
6470
// editUrl:
@@ -76,6 +82,15 @@ const config = {
7682
}),
7783
],
7884
],
85+
stylesheets: [
86+
{
87+
href: 'https://cdn.jsdelivr.net/npm/katex@0.13.24/dist/katex.min.css',
88+
type: 'text/css',
89+
integrity:
90+
'sha384-odtC+0UGzzFL/6PNoE8rX/SPcQDXBJ+uRepguP4QkPCm2LBxH3FA3y+fKSiJ+AmM',
91+
crossorigin: 'anonymous',
92+
},
93+
],
7994
plugins: [
8095
'docusaurus-plugin-sass',
8196
'./plugin/postcss-tailwind-loader',

‎package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,16 @@
3434
"clsx": "^1.2.1",
3535
"graphql": "^16.6.0",
3636
"graphql-request": "^6.0.0",
37+
"hast-util-is-element": "1.1.0",
3738
"js-cookie": "^3.0.5",
3839
"prism-react-renderer": "^1.3.5",
3940
"react": "^17.0.2",
4041
"react-dom": "^17.0.2",
4142
"react-icons": "^4.6.0",
4243
"react-pdf": "^7.0.1",
43-
"react-use": "^17.4.0"
44+
"react-use": "^17.4.0",
45+
"rehype-katex": "5",
46+
"remark-math": "3"
4447
},
4548
"devDependencies": {
4649
"@docusaurus/module-type-aliases": "2.3.1",

‎yarn.lock

+61-3
Original file line numberDiff line numberDiff line change
@@ -2118,6 +2118,11 @@
21182118
dependencies:
21192119
"@types/node" "*"
21202120

2121+
"@types/katex@^0.11.0":
2122+
version "0.11.1"
2123+
resolved "https://registry.npmmirror.com/@types/katex/-/katex-0.11.1.tgz#34de04477dcf79e2ef6c8d23b41a3d81f9ebeaf5"
2124+
integrity sha512-DUlIj2nk0YnJdlWgsFuVKcX27MLW0KbKmGVoUHmFr+74FYYNUDAaj9ZqTADvsbE8rfxuVmSFc7KczYn5Y09ozg==
2125+
21212126
"@types/mdast@^3.0.0":
21222127
version "3.0.10"
21232128
resolved "https://registry.npmmirror.com/@types/mdast/-/mdast-3.0.10.tgz"
@@ -3177,7 +3182,7 @@ commander@^7.2.0:
31773182
resolved "https://registry.npmmirror.com/commander/-/commander-7.2.0.tgz"
31783183
integrity sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==
31793184

3180-
commander@^8.3.0:
3185+
commander@^8.0.0, commander@^8.3.0:
31813186
version "8.3.0"
31823187
resolved "https://registry.npmmirror.com/commander/-/commander-8.3.0.tgz"
31833188
integrity sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==
@@ -4644,6 +4649,11 @@ hast-util-from-parse5@^6.0.0:
46444649
vfile-location "^3.2.0"
46454650
web-namespaces "^1.0.0"
46464651

4652+
hast-util-is-element@1.1.0, hast-util-is-element@^1.0.0:
4653+
version "1.1.0"
4654+
resolved "https://registry.npmmirror.com/hast-util-is-element/-/hast-util-is-element-1.1.0.tgz#3b3ed5159a2707c6137b48637fbfe068e175a425"
4655+
integrity sha512-oUmNua0bFbdrD/ELDSSEadRVtWZOf3iF6Lbv81naqsIV99RnSCieTbWuWCY8BAeEfKJTKl0gRdokv+dELutHGQ==
4656+
46474657
hast-util-parse-selector@^2.0.0:
46484658
version "2.2.5"
46494659
resolved "https://registry.npmmirror.com/hast-util-parse-selector/-/hast-util-parse-selector-2.2.5.tgz"
@@ -4676,6 +4686,15 @@ hast-util-to-parse5@^6.0.0:
46764686
xtend "^4.0.0"
46774687
zwitch "^1.0.0"
46784688

4689+
hast-util-to-text@^2.0.0:
4690+
version "2.0.1"
4691+
resolved "https://registry.npmmirror.com/hast-util-to-text/-/hast-util-to-text-2.0.1.tgz#04f2e065642a0edb08341976084aa217624a0f8b"
4692+
integrity sha512-8nsgCARfs6VkwH2jJU9b8LNTuR4700na+0h3PqCaEk4MAnMDeu5P0tP8mjk9LLNGxIeQRLbiDbZVw6rku+pYsQ==
4693+
dependencies:
4694+
hast-util-is-element "^1.0.0"
4695+
repeat-string "^1.0.0"
4696+
unist-util-find-after "^3.0.0"
4697+
46794698
hastscript@^6.0.0:
46804699
version "6.0.0"
46814700
resolved "https://registry.npmmirror.com/hastscript/-/hastscript-6.0.0.tgz"
@@ -5304,6 +5323,13 @@ jsonfile@^6.0.1:
53045323
optionalDependencies:
53055324
graceful-fs "^4.1.6"
53065325

5326+
katex@^0.13.0:
5327+
version "0.13.24"
5328+
resolved "https://registry.npmmirror.com/katex/-/katex-0.13.24.tgz#fe55455eb455698cb24b911a353d16a3c855d905"
5329+
integrity sha512-jZxYuKCma3VS5UuxOx/rFV1QyGSl3Uy/i0kTJF3HgQ5xMinCQVF8Zd4bMY/9aI9b9A2pjIBOsjSSm68ykTAr8w==
5330+
dependencies:
5331+
commander "^8.0.0"
5332+
53075333
keyv@^3.0.0:
53085334
version "3.1.0"
53095335
resolved "https://registry.npmmirror.com/keyv/-/keyv-3.1.0.tgz"
@@ -7061,6 +7087,26 @@ regjsparser@^0.9.1:
70617087
dependencies:
70627088
jsesc "~0.5.0"
70637089

7090+
rehype-katex@5:
7091+
version "5.0.0"
7092+
resolved "https://registry.npmmirror.com/rehype-katex/-/rehype-katex-5.0.0.tgz#b556f24fde918f28ba1cb642ea71c7e82f3373d7"
7093+
integrity sha512-ksSuEKCql/IiIadOHiKRMjypva9BLhuwQNascMqaoGLDVd0k2NlE2wMvgZ3rpItzRKCd6vs8s7MFbb8pcR0AEg==
7094+
dependencies:
7095+
"@types/katex" "^0.11.0"
7096+
hast-util-to-text "^2.0.0"
7097+
katex "^0.13.0"
7098+
rehype-parse "^7.0.0"
7099+
unified "^9.0.0"
7100+
unist-util-visit "^2.0.0"
7101+
7102+
rehype-parse@^7.0.0:
7103+
version "7.0.1"
7104+
resolved "https://registry.npmmirror.com/rehype-parse/-/rehype-parse-7.0.1.tgz#58900f6702b56767814afc2a9efa2d42b1c90c57"
7105+
integrity sha512-fOiR9a9xH+Le19i4fGzIEowAbwG7idy2Jzs4mOrFWBSJ0sNUgy0ev871dwWnbOo371SjgjG4pwzrbgSVrKxecw==
7106+
dependencies:
7107+
hast-util-from-parse5 "^6.0.0"
7108+
parse5 "^6.0.0"
7109+
70647110
relateurl@^0.2.7:
70657111
version "0.2.7"
70667112
resolved "https://registry.npmmirror.com/relateurl/-/relateurl-0.2.7.tgz"
@@ -7080,6 +7126,11 @@ remark-footnotes@2.0.0:
70807126
resolved "https://registry.npmmirror.com/remark-footnotes/-/remark-footnotes-2.0.0.tgz"
70817127
integrity sha512-3Clt8ZMH75Ayjp9q4CorNeyjwIxHFcTkaektplKGl2A1jNGEUey8cKL0ZC5vJwfcD5GFGsNLImLG/NGzWIzoMQ==
70827128

7129+
remark-math@3:
7130+
version "3.0.1"
7131+
resolved "https://registry.npmmirror.com/remark-math/-/remark-math-3.0.1.tgz#85a02a15b15cad34b89a27244d4887b3a95185bb"
7132+
integrity sha512-epT77R/HK0x7NqrWHdSV75uNLwn8g9qTyMqCRCDujL0vj/6T6+yhdrR7mjELWtkse+Fw02kijAaBuVcHBor1+Q==
7133+
70837134
remark-mdx@1.6.22:
70847135
version "1.6.22"
70857136
resolved "https://registry.npmmirror.com/remark-mdx/-/remark-mdx-1.6.22.tgz"
@@ -7134,7 +7185,7 @@ renderkid@^3.0.0:
71347185
lodash "^4.17.21"
71357186
strip-ansi "^6.0.1"
71367187

7137-
repeat-string@^1.5.4:
7188+
repeat-string@^1.0.0, repeat-string@^1.5.4:
71387189
version "1.6.1"
71397190
resolved "https://registry.npmmirror.com/repeat-string/-/repeat-string-1.6.1.tgz"
71407191
integrity sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==
@@ -8148,7 +8199,7 @@ unified@9.2.0:
81488199
trough "^1.0.0"
81498200
vfile "^4.0.0"
81508201

8151-
unified@^9.2.2:
8202+
unified@^9.0.0, unified@^9.2.2:
81528203
version "9.2.2"
81538204
resolved "https://registry.npmmirror.com/unified/-/unified-9.2.2.tgz"
81548205
integrity sha512-Sg7j110mtefBD+qunSLO1lqOEKdrwBFBrR6Qd8f4uwkhWNlbkaqwHse6e7QvD3AP/MNoJdEDLaf8OxYyoWgorQ==
@@ -8172,6 +8223,13 @@ unist-builder@2.0.3, unist-builder@^2.0.0:
81728223
resolved "https://registry.npmmirror.com/unist-builder/-/unist-builder-2.0.3.tgz"
81738224
integrity sha512-f98yt5pnlMWlzP539tPc4grGMsFaQQlP/vM396b00jngsiINumNmsY8rkXjfoi1c6QaM8nQ3vaGDuoKWbe/1Uw==
81748225

8226+
unist-util-find-after@^3.0.0:
8227+
version "3.0.0"
8228+
resolved "https://registry.npmmirror.com/unist-util-find-after/-/unist-util-find-after-3.0.0.tgz#5c65fcebf64d4f8f496db46fa8fd0fbf354b43e6"
8229+
integrity sha512-ojlBqfsBftYXExNu3+hHLfJQ/X1jYY/9vdm4yZWjIbf0VuWF6CRufci1ZyoD/wV2TYMKxXUoNuoqwy+CkgzAiQ==
8230+
dependencies:
8231+
unist-util-is "^4.0.0"
8232+
81758233
unist-util-generated@^1.0.0:
81768234
version "1.1.6"
81778235
resolved "https://registry.npmmirror.com/unist-util-generated/-/unist-util-generated-1.1.6.tgz"

0 commit comments

Comments
 (0)
Please sign in to comment.