Skip to content

Commit cc3a3e9

Browse files
committed
Fix shiki
1 parent 0b55a3a commit cc3a3e9

File tree

7 files changed

+528
-20
lines changed

7 files changed

+528
-20
lines changed

astro.config.ts

+16-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { defineConfig } from 'astro/config';
22
import tailwind from "@astrojs/tailwind";
33
import remarkLesetid from "remark-lesetid/astro";
44
import { rehypeTitles, rehypeCodeCopy, rehypePreClass, rehypeH1 } from './src/rehype';
5-
import { rehypeHeadingIds } from '@astrojs/markdown-remark';
5+
import { rehypeHeadingIds, rehypeShiki, type ShikiConfig } from '@astrojs/markdown-remark';
66
import { remarkAlert } from 'remark-github-blockquote-alert';
77
import react from "@astrojs/react";
88
import arraybuffer from "vite-plugin-arraybuffer";
@@ -32,6 +32,12 @@ export default defineConfig({
3232
markdown: {
3333
gfm: true,
3434
syntaxHighlight: false,
35+
// shikiConfig: {
36+
// // theme: 'github-dark',
37+
// light: "github-light",
38+
// dark: "ayu-dark",
39+
// }
40+
// },
3541
remarkPlugins: [
3642
remarkMark,
3743
remarkAlert,
@@ -43,6 +49,15 @@ export default defineConfig({
4349
rehypeHeadingIds,
4450
rehypeTitles,
4551
rehypeCodeCopy,
52+
[
53+
rehypeShiki,
54+
{
55+
themes: {
56+
dark: "github-dark",
57+
light: "github-light",
58+
},
59+
} as ShikiConfig
60+
],
4661
rehypePreClass,
4762
[
4863
rehypeSectionHeadings,

0 commit comments

Comments
 (0)