Skip to content

Commit 4f4c7f5

Browse files
Merge branch 'main' of github.com:multitheftauto/wiki.multitheftauto.com
2 parents e6937f7 + cfde894 commit 4f4c7f5

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

web/astro.config.mjs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { defineConfig } from 'astro/config';
33
import starlight from '@astrojs/starlight';
44
import mtasaStarlightThemePlugin from '@multitheftauto/starlight-theme-mtasa';
55
import { SITE_TITLE, SITE_URL } from './src/content.constants';
6+
import fs from 'fs';
7+
import path from 'path';
68

79
export default defineConfig({
810
site: SITE_URL,
@@ -99,4 +101,21 @@ export default defineConfig({
99101
],
100102
}),
101103
],
104+
105+
vite: {
106+
plugins: [
107+
{
108+
name: 'override-pagefind-config',
109+
closeBundle: async () => {
110+
const configPath = path.join('dist', 'pagefind', 'pagefind.json');
111+
112+
if (fs.existsSync(configPath)) {
113+
let config = JSON.parse(fs.readFileSync(configPath, 'utf-8'));
114+
config.source = 'pages';
115+
fs.writeFileSync(configPath, JSON.stringify(config));
116+
}
117+
},
118+
},
119+
],
120+
}
102121
});

0 commit comments

Comments
 (0)