Skip to content

Commit 3b23662

Browse files
Easier Forking (#60)
1 parent 51492eb commit 3b23662

File tree

3 files changed

+4
-11
lines changed

3 files changed

+4
-11
lines changed

src/MudBlazorGitHubPages/MudBlazorGitHubPages.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<ImplicitUsings>enable</ImplicitUsings>
77
<ServiceWorkerAssetsManifest>service-worker-assets.js</ServiceWorkerAssetsManifest>
88
<AssemblyVersion>1.0.0</AssemblyVersion>
9+
<GHPages>true</GHPages>
910
</PropertyGroup>
1011

1112

@@ -18,6 +19,7 @@
1819
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.4" />
1920
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="9.0.4" PrivateAssets="all" />
2021
<PackageReference Include="MudBlazor" Version="8.5.1" />
22+
<PackageReference Include="PublishSPAforGitHubPages.Build" Version="3.0.0" />
2123
<PackageReference Include="Serilog" Version="4.2.0" />
2224
<PackageReference Include="Serilog.Sinks.BrowserConsole" Version="8.0.0" />
2325
<PackageReference Include="System.Text.Json" Version="9.0.4" />

src/MudBlazorGitHubPages/wwwroot/index.html

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,7 @@
55
<meta charset="utf-8" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
77
<title>MudBlazorGitHubPages</title>
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-
8+
<base href="/" />
189
<link rel="stylesheet" href="css/app.css" />
1910
<link rel="icon" type="image/png" href="favicon.png" />
2011
<link href="MudBlazorGitHubPages.styles.css" rel="stylesheet" />

src/MudBlazorGitHubPages/wwwroot/service-worker.published.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ self.addEventListener('fetch', event => event.respondWith(onFetch(event)));
88

99
const cacheNamePrefix = 'offline-cache-';
1010
const cacheName = `${cacheNamePrefix}${self.assetsManifest.version}`;
11-
const offlineAssetsInclude = [ /\.dll$/, /\.pdb$/, /\.wasm/, /\.html/, /\.js$/, /\.json$/, /\.css$/, /\.woff$/, /\.png$/, /\.jpe?g$/, /\.gif$/, /\.ico$/, /\.blat$/, /\.dat$/ ];
11+
const offlineAssetsInclude = [ /\.dll$/, /\.pdb$/, /\.wasm/, /\.html/, /\.js$/, /\.json$/, /\.css$/, /\.woff$/, /\.png$/, /\.jpe?g$/, /\.gif$/, /\.ico$/, /\.blat$/, /\.dat$/, /\.br$/ ];
1212
const offlineAssetsExclude = [ /^service-worker\.js$/ ];
1313

1414
// Replace with your base path if you are hosting on a subfolder. Ensure there is a trailing '/'.

0 commit comments

Comments
 (0)