Skip to content

Commit 8132619

Browse files
Base Path
1 parent 6a848e9 commit 8132619

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/MudBlazorPages/wwwroot/index.html

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,16 @@
55
<meta charset="utf-8" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
77
<title>MudBlazorPages</title>
8-
<base href="/" />
8+
9+
<!-- Adapted from https://stackoverflow.com/a/69769086/8435941 -->
10+
<script>
11+
var baseTag = document.createElement("base");
12+
var appRoot = "/CHANGEME/";
13+
var path = document.location.pathname;
14+
baseTag.href = (path.indexOf(appRoot) === 0 || path + "/" === appRoot) ? appRoot : "/";
15+
document.head.appendChild(baseTag);
16+
</script>
17+
918
<link rel="stylesheet" href="css/app.css" />
1019
<link rel="icon" type="image/png" href="favicon.png" />
1120
<link href="MudBlazorPages.styles.css" rel="stylesheet" />

0 commit comments

Comments
 (0)