Skip to content

Commit

Permalink
fix: Home redirect with hash or query params
Browse files Browse the repository at this point in the history
  • Loading branch information
gadenbuie committed Jul 9, 2024
1 parent d255195 commit fd4d3b0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions inst/pkgdown/templates/in-header-home.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<!-- from quillt: JS redirect for homepage -->
<script>
if (!/(\/|html?)$/.test(window.location.href)){
window.location.replace(window.location.href + '/');
if (!/(\/|html?)$/.test(window.location.pathname)) {
const newHome = new URL(window.location.href);
newHome.pathname = newHome.pathname + '/';
window.location.replace(newHome.toString())
}
</script>

0 comments on commit fd4d3b0

Please sign in to comment.