File tree Expand file tree Collapse file tree 2 files changed +22
-4
lines changed Expand file tree Collapse file tree 2 files changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -136,10 +136,7 @@ export default defineConfig({
136136 ]
137137 : [ ] ) ,
138138 starlightDocSearch ( {
139- appId : "D32WIYFTUF" ,
140- apiKey : "5cec275adc19dd3bc17617f7d9cf312a" ,
141- indexName : "prod_devdocs" ,
142- insights : true ,
139+ clientOptionsModule : "./src/plugins/docsearch/index.ts" ,
143140 } ) ,
144141 starlightImageZoom ( ) ,
145142 ] ,
Original file line number Diff line number Diff line change 1+ import type { DocSearchClientOptions } from "@astrojs/starlight-docsearch" ;
2+
3+ export default {
4+ appId : "D32WIYFTUF" ,
5+ apiKey : "5cec275adc19dd3bc17617f7d9cf312a" ,
6+ indexName : "prod_devdocs" ,
7+ insights : true ,
8+ // Replace URL with the current origin so search
9+ // can be used in local development and previews.
10+ transformItems ( items ) {
11+ return items . map ( ( item ) => {
12+ const path = new URL ( item . url ) . pathname ;
13+ const url = new URL ( path , window . origin ) ;
14+
15+ return {
16+ ...item ,
17+ url : url . toString ( ) ,
18+ } ;
19+ } ) ;
20+ } ,
21+ } satisfies DocSearchClientOptions ;
You can’t perform that action at this time.
0 commit comments