Skip to content

Commit 807998d

Browse files
committed
Refactor base URL construction in Maturity Editor to include pathname for GitHub Pages compatibility
1 parent e3bf5c5 commit 807998d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/app/maturity/maturity-editor/maturity-editor.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -820,7 +820,8 @@ export class MaturityEditorComponent implements OnInit {
820820
localStorage.setItem('maturitySpecPreview', specJson);
821821
// Open maturity-main in a new tab/window with preview mode
822822
// Use hash routing format
823-
const baseUrl = window.location.origin;
823+
// Get base URL including pathname to handle GitHub Pages subdirectory
824+
const baseUrl = window.location.href.split('#')[0].replace(/\/$/, '');
824825
window.open(`${baseUrl}/#/maturity?preview=true`, '_blank');
825826
this.showMessage('Opening preview in new tab...', 'success');
826827
} catch (error) {

0 commit comments

Comments
 (0)