Skip to content

Commit

Permalink
#217 Update website to be on root of domain
Browse files Browse the repository at this point in the history
  • Loading branch information
braxtonhall committed Dec 31, 2022
1 parent 6520f19 commit c5dde66
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion 404.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
</head>
<body></body>
<script>
window.location.href = `/library-thing/#${window.location.pathname.replace("library-thing/", "")}`;
window.location.href = `#${window.location.pathname}`;
</script>
</html>
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
<script>
let md = "README.md";
if (window.location.hash.length > 1) {
const path = window.location.hash.replace('#', '').replace(/^\//, '');
history.pushState({ page: 1 }, "Redirecting", `/library-thing/${path}`);
const path = window.location.hash.replace('#', '');
history.pushState({ page: 1 }, "Redirecting", path);
md = path.replace(/\.pretty/, '');
}

Expand All @@ -60,7 +60,7 @@
const $element = $(element);
const href = $element.attr("href");
if (href.endsWith(".md")) {
$element.attr("href", `/library-thing/${href}.pretty`);
$element.attr("href", `${href}.pretty`);
}
});

Expand Down

0 comments on commit c5dde66

Please sign in to comment.