mirror of
https://github.com/Snigdha-OS/Snigdha-OS.github.io.git
synced 2025-09-07 21:25:17 +02:00
Updates
This commit is contained in:
30
index.html
30
index.html
@@ -54,25 +54,29 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
(function(l) {
|
(function(l) {
|
||||||
if (l.search && l.search.startsWith('/')) {
|
if (l.search && l.search.startsWith('/')) {
|
||||||
// Extract and clean up the query string
|
// Extract the search string and remove the leading slash
|
||||||
const decoded = l.search
|
const originalQuery = l.search.slice(1);
|
||||||
.slice(1) // Remove the leading "/"
|
|
||||||
.split('&') // Split the query string by "&"
|
|
||||||
.filter(Boolean) // Remove empty strings caused by consecutive "&"
|
|
||||||
.map(s => s.replace(/~and~/g, '&')) // Replace "~and~" with "&"
|
|
||||||
.join('&'); // Join back with "&"
|
|
||||||
|
|
||||||
// Reconstruct the URL and replace the history entry
|
// Split by '&' and process each part
|
||||||
window.history.replaceState(
|
const decodedParts = originalQuery
|
||||||
null,
|
.split('&')
|
||||||
'', // Keep the title unchanged
|
.filter(Boolean) // Remove empty parts
|
||||||
`${l.pathname.slice(0, -1)}${decoded ? `?${decoded}` : ''}${l.hash}` // Build the new URL
|
.map(part => part.replace(/~and~/g, '&')); // Replace "~and~" with "&"
|
||||||
);
|
|
||||||
|
// Join the parts back into a valid query string
|
||||||
|
const decodedQuery = decodedParts.join('&');
|
||||||
|
|
||||||
|
// Avoid applying the replacement if the query string is unchanged
|
||||||
|
const newUrl = `${l.pathname.slice(0, -1)}${decodedQuery ? `?${decodedQuery}` : ''}${l.hash}`;
|
||||||
|
if (newUrl !== l.href) {
|
||||||
|
window.history.replaceState(null, '', newUrl);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})(window.location);
|
})(window.location);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<script type="module" crossorigin src="/assets/index-BvOIUj_o.js"></script>
|
<script type="module" crossorigin src="/assets/index-BvOIUj_o.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="/assets/index-InsxKvgR.css">
|
<link rel="stylesheet" crossorigin href="/assets/index-InsxKvgR.css">
|
||||||
</head>
|
</head>
|
||||||
|
Reference in New Issue
Block a user