Skip to content

Commit

Permalink
testing
Browse files Browse the repository at this point in the history
  • Loading branch information
rajbos committed Aug 21, 2024
1 parent 1212829 commit 6eb41e7
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions public/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,27 @@
}
console.log(`pathname: ${pathname}`);

// Construct the new URL (only needed for forks with a subfolder, should not be used on https://github-copilot.xebia.ms!)
let basePath = pathname + '/#';
// check if the url is for prod
if (!window.location.hostname === 'github-copilot.xebia.ms') {
// Redirect to the root of the fork
basePath = '/copilot-videos/#' + pathname.replace('copilot-videos', '');
// Determine the base path based on the hostname
let basePath = '';
if (window.location.hostname === 'github-copilot.xebia.ms') {
basePath = pathname + '/#';
} else {
basePath = '/copilot-videos/#' + pathname.replace('copilot-videos/', '');
}

// get the search up to the first slash or question mark
searchBeginning = search.split(/[/?]/)[0];
// Get the search up to the first slash or question mark
let searchBeginning = search.split(/[/?]/)[0];
if (basePath.includes(searchBeginning)) {
// Remove the search from the basePath
search = search.replace(searchBeginning, '');
}

// If there are double slashes anywhere in the url, remove them
// If there are double slashes anywhere in the URL, remove them
if (basePath.includes('//')) {
basePath = basePath.replace('//', '/');
}
// log the parts for debugging

// Log the parts for debugging
console.log(`search: ${search}`);
console.log(`basePath: ${basePath}`);

Expand Down

0 comments on commit 6eb41e7

Please sign in to comment.