File tree Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,33 @@ import { readFileSync } from "node:fs";
22import { defineConfig } from "astro/config" ;
33import starlight from "@astrojs/starlight" ;
44
5+ const starlightPlugin = {
6+ name : "RescriptAPIDocs" ,
7+ hooks : {
8+ setup : ( { config, updateConfig, addIntegration } ) => {
9+ console . log ( `Setup yow!` )
10+ addIntegration ( {
11+ name : "RescriptAPIDocs" ,
12+ hooks : {
13+ "astro:config:setup" : ( { injectRoute } ) => {
14+ injectRoute ( {
15+ pattern : "meh" ,
16+ entrypoint : "docs/apidocs/meh.astro"
17+ } )
18+ }
19+ }
20+ } )
21+
22+ updateConfig ( {
23+ sidebar : [
24+ ...config . sidebar ,
25+ { label : "meh" , link : "meh" }
26+ ]
27+ } ) ;
28+ }
29+ }
30+ }
31+
532const rescriptTM = JSON . parse (
633 readFileSync ( "./docs/assets/rescript.tmLanguage.json" , "utf-8" ) ,
734) ;
@@ -44,6 +71,7 @@ export default defineConfig({
4471 langs : [ rescriptTM ] ,
4572 } ,
4673 } ,
74+ plugins : [ starlightPlugin ] ,
4775 } ) ,
4876 ] ,
4977} ) ;
Original file line number Diff line number Diff line change 1+ ---
2+ import StarlightPage from " @astrojs/starlight/components/StarlightPage.astro" ;
3+
4+ const frontmatter = {
5+ title: " Meh" ,
6+ }
7+ ---
8+
9+ <StarlightPage frontmatter ={ frontmatter } >
10+ <h1 >Muhahah</h1 >
11+ </StarlightPage >
You can’t perform that action at this time.
0 commit comments