chore: remove base path

This commit is contained in:
Danish Arora 2024-11-08 10:40:26 +07:00
parent 86f538e93e
commit b5f4b16b58
No known key found for this signature in database
GPG Key ID: 1C6EF37CDAE1426E
3 changed files with 7 additions and 20 deletions

View File

@ -2,11 +2,10 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/buddybook/favicon.svg" />
<link rel="icon" type="image/png" href="/buddybook/favicon.png" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<link rel="icon" type="image/png" href="/favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>BuddyBook Dogfood</title>
<base href="/buddybook/" />
<script>
window.global = window;
window.process = {
@ -20,23 +19,11 @@
browser: true
};
</script>
<script type="text/javascript">
(function(l) {
if (l.search[1] === '/' ) {
var decoded = l.search.slice(1).split('&').map(function(s) {
return s.replace(/~and~/g, '&')
}).join('?');
window.history.replaceState(null, null,
l.pathname.slice(0, -1) + decoded + l.hash
);
}
}(window.location))
</script>
<script type="text/javascript">
(function() {
const path = window.location.pathname.substring('/buddybook/'.length);
const path = window.location.pathname;
if (path && !window.location.search.includes('?/')) {
window.location.replace('/buddybook/?/' + path + window.location.search + window.location.hash);
window.location.replace('/?/' + path + window.location.search + window.location.hash);
}
})();
</script>

View File

@ -4,12 +4,12 @@
<meta charset="utf-8">
<title>BuddyBook</title>
<script type="text/javascript">
var pathSegmentsToKeep = 1;
var pathSegmentsToKeep = 0;
var l = window.location;
l.replace(
l.protocol + '//' + l.hostname + (l.port ? ':' + l.port : '') +
l.pathname.split('/').slice(0, 1 + pathSegmentsToKeep).join('/') + '/?/' +
'/?/' +
l.pathname.slice(1).split('/').slice(pathSegmentsToKeep).join('/').replace(/&/g, '~and~') +
(l.search ? '&' + l.search.slice(1).replace(/&/g, '~and~') : '') +
l.hash

View File

@ -6,7 +6,7 @@ export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), '')
return {
base: '/buddybook/',
base: '/',
plugins: [
react(),
{