Skip to content

Commit

Permalink
Fix base path on github pages
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasstich committed Mar 21, 2024
1 parent 2140c7b commit 21c1cda
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion WebAssembly/wwwroot/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,18 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>AdLer-Eingabeunterstützung</title>
<base href="/" />
<base />
<script>
var path = window.location.pathname.split('/');
var base = document.getElementsByTagName('base')[0];
if (window.location.host.includes('localhost')) {
base.setAttribute('href', '/');
} else if (path.length > 2) {
base.setAttribute('href', '/' + path[1] + '/');
} else if (path[path.length - 1].length != 0) {
window.location.replace(window.location.origin + window.location.pathname + '/' + window.location.search);
}
</script>
<link href="_content/Library/css/output.css" rel="stylesheet"/>
<link rel="icon" type="image/png" href="_content/Library/CustomIcons/AdLer_Logo.png" />
<link href="WebAssembly.styles.css" rel="stylesheet" />
Expand Down

0 comments on commit 21c1cda

Please sign in to comment.