mirror of
https://gitee.com/ant-design-blazor/ant-design-blazor.git
synced 2024-11-29 18:48:50 +08:00
add assets for github pages
This commit is contained in:
parent
74d8163756
commit
64890f94d8
7
.github/workflows/gh-pages.yml
vendored
7
.github/workflows/gh-pages.yml
vendored
@ -1,4 +1,4 @@
|
||||
name: publish gh-pages
|
||||
name: Publish Docs
|
||||
|
||||
on:
|
||||
push:
|
||||
@ -20,7 +20,7 @@ jobs:
|
||||
uses: einaregilsson/build-number@v2
|
||||
with:
|
||||
token: ${{secrets.github_token}}
|
||||
- name: Publish App
|
||||
- name: Publish Docs to github pages
|
||||
env:
|
||||
GH_PUSH_TOKEN: ${{secrets.GH_PUSH_TOKEN}}
|
||||
run: |
|
||||
@ -28,6 +28,9 @@ jobs:
|
||||
git config --global user.email 'shunjiey@hotmail.com'
|
||||
dotnet publish -c Release -o tmp
|
||||
cd tmp/AntBlazor.Docs.ClientApp/dist
|
||||
rm index.html
|
||||
cp -r gh-pages/* gh-pages/.nojekyll ./
|
||||
rm -r gh-pages
|
||||
git init
|
||||
git checkout -b gh-pages
|
||||
git add -A
|
||||
|
@ -11,6 +11,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AntBlazor.Docs.ServerApp",
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AntBlazor.Docs.ClientApp", "src\AntBlazor.Docs.ClientApp\AntBlazor.Docs.ClientApp.csproj", "{1FD08A02-2249-44F6-B79E-B2E6836D551F}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{0CB79B3D-E483-4051-8026-6A80FCA0C6A6}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
.github\workflows\gh-pages.yml = .github\workflows\gh-pages.yml
|
||||
README.md = README.md
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
|
38
src/AntBlazor.Docs.ClientApp/wwwroot/gh-pages/404.html
Normal file
38
src/AntBlazor.Docs.ClientApp/wwwroot/gh-pages/404.html
Normal file
@ -0,0 +1,38 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Single Page Apps for GitHub Pages</title>
|
||||
<script type="text/javascript">
|
||||
// Single Page Apps for GitHub Pages
|
||||
// https://github.com/rafrex/spa-github-pages
|
||||
// Copyright (c) 2016 Rafael Pedicini, licensed under the MIT License
|
||||
// ----------------------------------------------------------------------
|
||||
// This script takes the current url and converts the path and query
|
||||
// string into just a query string, and then redirects the browser
|
||||
// to the new url with only a query string and hash fragment,
|
||||
// e.g. http://www.foo.tld/one/two?a=b&c=d#qwe, becomes
|
||||
// http://www.foo.tld/?p=/one/two&q=a=b~and~c=d#qwe
|
||||
// Note: this 404.html file must be at least 512 bytes for it to work
|
||||
// with Internet Explorer (it is currently > 512 bytes)
|
||||
// If you're creating a Project Pages site and NOT using a custom domain,
|
||||
// then set segmentCount to 1 (enterprise users may need to set it to > 1).
|
||||
// This way the code will only replace the route part of the path, and not
|
||||
// the real directory in which the app resides, for example:
|
||||
// https://username.github.io/repo-name/one/two?a=b&c=d#qwe becomes
|
||||
// https://username.github.io/repo-name/?p=/one/two&q=a=b~and~c=d#qwe
|
||||
// Otherwise, leave segmentCount as 0.
|
||||
var segmentCount = 1;
|
||||
var l = window.location;
|
||||
l.replace(
|
||||
l.protocol + '//' + l.hostname + (l.port ? ':' + l.port : '') +
|
||||
l.pathname.split('/').slice(0, 1 + segmentCount).join('/') + '/?p=/' +
|
||||
l.pathname.slice(1).split('/').slice(segmentCount).join('/').replace(/&/g, '~and~') +
|
||||
(l.search ? '&q=' + l.search.slice(1).replace(/&/g, '~and~') : '') +
|
||||
l.hash
|
||||
);
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
55
src/AntBlazor.Docs.ClientApp/wwwroot/gh-pages/index.html
Normal file
55
src/AntBlazor.Docs.ClientApp/wwwroot/gh-pages/index.html
Normal file
@ -0,0 +1,55 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
<title>AntBlazor.Docs.ClientApp</title>
|
||||
<base href="/ant-design-blazor/" />
|
||||
<link href="css/bootstrap/bootstrap.min.css" rel="stylesheet" />
|
||||
<link href="css/site.css" rel="stylesheet" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<app>Loading...</app>
|
||||
|
||||
<!-- Start Single Page Apps for GitHub Pages -->
|
||||
<script type="text/javascript">
|
||||
// Single Page Apps for GitHub Pages
|
||||
// https://github.com/rafrex/spa-github-pages
|
||||
// Copyright (c) 2016 Rafael Pedicini, licensed under the MIT License
|
||||
// ----------------------------------------------------------------------
|
||||
// This script checks to see if a redirect is present in the query string
|
||||
// and converts it back into the correct url and adds it to the
|
||||
// browser's history using window.history.replaceState(...),
|
||||
// which won't cause the browser to attempt to load the new url.
|
||||
// When the single page app is loaded further down in this file,
|
||||
// the correct url will be waiting in the browser's history for
|
||||
// the single page app to route accordingly.
|
||||
(function (l) {
|
||||
if (l.search) {
|
||||
var q = {};
|
||||
l.search.slice(1).split('&').forEach(function (v) {
|
||||
var a = v.split('=');
|
||||
q[a[0]] = a.slice(1).join('=').replace(/~and~/g, '&');
|
||||
});
|
||||
if (q.p !== undefined) {
|
||||
window.history.replaceState(null, null,
|
||||
l.pathname.slice(0, -1) + (q.p || '') +
|
||||
(q.q ? ('?' + q.q) : '') +
|
||||
l.hash
|
||||
);
|
||||
}
|
||||
}
|
||||
}(window.location))
|
||||
</script>
|
||||
<!-- End Single Page Apps for GitHub Pages -->
|
||||
|
||||
<div id="blazor-error-ui">
|
||||
An unhandled error has occurred.
|
||||
<a href="" class="reload">Reload</a>
|
||||
<a class="dismiss">🗙</a>
|
||||
</div>
|
||||
<script src="_framework/blazor.webassembly.js"></script>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user