@@ -13,6 +13,7 @@ import { h } from "hastscript";
13
13
import { readdir } from "fs/promises" ;
14
14
import icon from "astro-icon" ;
15
15
import sitemap from "@astrojs/sitemap" ;
16
+ import react from "@astrojs/react" ;
16
17
import rehypeTitleFigure from "rehype-title-figure" ;
17
18
18
19
const runLinkCheck = process . env . RUN_LINK_CHECK || false ;
@@ -35,25 +36,35 @@ async function autogenSections() {
35
36
} ;
36
37
} ) ;
37
38
}
38
-
39
39
const AnchorLinkIcon = h (
40
40
"span" ,
41
- { ariaHidden : "true" , class : "anchor-icon" } ,
41
+ {
42
+ ariaHidden : "true" ,
43
+ class : "anchor-icon" ,
44
+ } ,
42
45
h (
43
46
"svg" ,
44
- { width : 16 , height : 16 , viewBox : "0 0 24 24" } ,
47
+ {
48
+ width : 16 ,
49
+ height : 16 ,
50
+ viewBox : "0 0 24 24" ,
51
+ } ,
45
52
h ( "path" , {
46
53
fill : "currentcolor" ,
47
54
d : "m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 0 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 1 0-1.42-1.42Zm8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 0 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 1 0 1.42 1.42l3.88-3.89a4.49 4.49 0 0 0 0-6.33ZM8.83 15.17a1 1 0 0 0 1.1.22 1 1 0 0 0 .32-.22l4.92-4.92a1 1 0 0 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42Z" ,
48
55
} ) ,
49
56
) ,
50
57
) ;
51
-
52
58
const autolinkConfig = {
53
- properties : { class : "anchor-link" } ,
59
+ properties : {
60
+ class : "anchor-link" ,
61
+ } ,
54
62
behavior : "after" ,
55
63
group : ( { tagName } ) =>
56
- h ( "div" , { tabIndex : - 1 , class : `heading-wrapper level-${ tagName } ` } ) ,
64
+ h ( "div" , {
65
+ tabIndex : - 1 ,
66
+ class : `heading-wrapper level-${ tagName } ` ,
67
+ } ) ,
57
68
content : ( ) => [ AnchorLinkIcon ] ,
58
69
} ;
59
70
@@ -89,6 +100,7 @@ export default defineConfig({
89
100
} ,
90
101
experimental : {
91
102
contentIntellisense : true ,
103
+ contentLayer : true ,
92
104
} ,
93
105
server : {
94
106
port : 1111 ,
@@ -196,14 +208,17 @@ export default defineConfig({
196
208
tailwind ( {
197
209
applyBaseStyles : false ,
198
210
} ) ,
199
- liveCode ( { layout : "~/components/live-code/Layout.astro" } ) ,
211
+ liveCode ( {
212
+ layout : "~/components/live-code/Layout.astro" ,
213
+ } ) ,
200
214
icon ( ) ,
201
215
sitemap ( {
202
216
serialize ( item ) {
203
217
item . lastmod = new Date ( ) ;
204
218
return item ;
205
219
} ,
206
220
} ) ,
221
+ react ( ) ,
207
222
] ,
208
223
vite : {
209
224
build : {
0 commit comments