Skip to content

Commit

Permalink
Update projects.html
Browse files Browse the repository at this point in the history
  • Loading branch information
Sayad-Uddin-Tahsin authored Jun 21, 2024
1 parent 16cb1d9 commit b8d6491
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions projects.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,21 @@
}
})
</script>

<script>
document.addEventListener("DOMContentLoaded", function() {
var currentUrl = window.location.href;
if (currentUrl.includes("github.io") && currentUrl.endsWith(".html")) {
if (currentUrl.split('/').slice(-1)[0].indexOf('.') === -1) {
var newUrl = currentUrl.replace(/\.html$/, '');
if (newUrl !== currentUrl) {
window.history.replaceState(null, null, newUrl);
}
}
}
});
// Get the current URL
var currentUrl = window.location.href;

// Check if the URL ends with github.io and contains .html
if (currentUrl.includes("github.io") && currentUrl.endsWith(".html")) {
// Remove the .html extension
var newUrl = currentUrl.replace(/\.html$/, '');

// Redirect to the new URL
window.history.replaceState(null, null, newUrl);
}
});
</script>
</head>

Expand Down Expand Up @@ -235,6 +238,8 @@ <h2>sra-pylib</h2>
<footer>
<p>&copy; 2024 Sayad Uddin Tahsin<br>All Rights Reserved.</p>
</footer>

<script src"script.js"></script>
</body>

</html>

0 comments on commit b8d6491

Please sign in to comment.