Skip to content

Commit fce60fc

Browse files
committed
chore: make docs site work on github pages site
1 parent 3cc5c8e commit fce60fc

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

docs-viewer/src/-utils.ts

+9
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,15 @@ export async function maybeMakePNPMInstallable(details: ReturnType<typeof repoDe
133133
// deactivate prember
134134
const newFile = buildFile.replace('prember: {', '__prember: {');
135135
fs.writeFileSync(path.join(details.location, 'ember-cli-build.js'), newFile);
136+
137+
if (process.env.CI) {
138+
// in CI we need to change the routing setup to prepare for deployment to github pages
139+
const routerFile = fs.readFileSync(path.join(details.location, 'config/environment.js'), 'utf8');
140+
let newFile = routerFile.replace("rootURL: '/'", "rootURL: '/data/'");
141+
newFile = newFile.replace("locationType: 'auto'", "locationType: 'hash'");
142+
newFile = newFile.replace("routerRootURL: '/'", "routerRootURL: '/data/'");
143+
fs.writeFileSync(path.join(details.location, 'config/environment.js'), newFile);
144+
}
136145
}
137146

138147
const proc = Bun.spawn(['git', 'commit', '-am', '"ensure volta works as expected"'], {

0 commit comments

Comments
 (0)