-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(docs): add redirect function for /current path (#3922)
- Loading branch information
Showing
4 changed files
with
131 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,22 +68,31 @@ jobs: | |
MAVEN_PASSWORD: ${{ secrets.OSS_SONATYPE_PASSWORD }} | ||
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} | ||
|
||
- name: Deploy Asciidoc docs output to GitHub Pages | ||
- name: Deploy documentation to GitHub Pages for version ${{ github.event.inputs.releaseversion }} | ||
uses: JamesIves/[email protected] | ||
with: | ||
branch: gh-pages # The branch the action should deploy to. | ||
folder: spring-boot-admin-docs/target/generated-docs # The folder the action should deploy. | ||
branch: gh-pages | ||
folder: spring-boot-admin-docs/target/generated-docs | ||
target-folder: ${{ github.event.inputs.releaseversion }} | ||
clean: true # Automatically remove deleted files from the deploy branch | ||
clean: true | ||
|
||
- name: Deploy Asciidoc docs output to GitHub Pages | ||
- name: Deploy redirect for /current to /${{ github.event.inputs.releaseversion }} | ||
uses: JamesIves/[email protected] | ||
if: github.event.inputs.copyDocsToCurrent == 'true' | ||
with: | ||
branch: gh-pages # The branch the action should deploy to. | ||
folder: spring-boot-admin-docs/target/generated-docs/current # The folder the action should deploy. | ||
branch: gh-pages | ||
folder: spring-boot-admin-docs/target/generated-docs/current | ||
target-folder: /current | ||
clean: true # Automatically remove deleted files from the deploy branch | ||
clean: true | ||
|
||
- name: Deploy deeplink redirect for /current/* to /${{ github.event.inputs.releaseversion }}/* | ||
uses: JamesIves/[email protected] | ||
if: github.event.inputs.copyDocsToCurrent == 'true' | ||
with: | ||
branch: gh-pages | ||
folder: spring-boot-admin-docs/target/generated-docs/current | ||
target-folder: / | ||
clean: false | ||
|
||
publish-github-release: | ||
needs: publish-central-and-pages | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,3 +18,4 @@ | |
npm-debug.log* | ||
|
||
current/index.html | ||
current/404.html |
111 changes: 111 additions & 0 deletions
111
spring-boot-admin-docs/src/site/current/404.template.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
<!DOCTYPE html> | ||
<html lang='en'> | ||
<head> | ||
<meta charset='utf-8'> | ||
<title>Page not found · GitHub Pages</title> | ||
<script type='text/javascript'> | ||
function getRedirectUrl() { | ||
const l = window.location; | ||
if (l.pathname.includes("/current")) { | ||
return l.protocol + "//" + l.hostname + (l.port ? ":" + l.port : "") + | ||
[ | ||
"", | ||
"@@VERSION@@", | ||
l.pathname.split("/").slice(2) | ||
].join("/") | ||
+ | ||
l.hash; | ||
} | ||
} | ||
|
||
const redirectUrl = getRedirectUrl(); | ||
if (redirectUrl) { | ||
window.location.replace(redirectUrl); | ||
} | ||
</script> | ||
|
||
<style type="text/css" media="screen"> | ||
body { | ||
background-color: #f1f1f1; | ||
margin: 0; | ||
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; | ||
} | ||
|
||
.container { | ||
margin: 50px auto 40px auto; | ||
width: 600px; | ||
text-align: center; | ||
} | ||
|
||
a { | ||
color: #4183c4; | ||
text-decoration: none; | ||
} | ||
|
||
a:hover { | ||
text-decoration: underline; | ||
} | ||
|
||
h1 { | ||
width: 800px; | ||
position: relative; | ||
left: -100px; | ||
letter-spacing: -1px; | ||
line-height: 60px; | ||
font-size: 60px; | ||
font-weight: 100; | ||
margin: 0 0 50px 0; | ||
text-shadow: 0 1px 0 #fff; | ||
} | ||
|
||
p { | ||
color: rgba(0, 0, 0, 0.5); | ||
margin: 20px 0; | ||
line-height: 1.6; | ||
} | ||
|
||
ul { | ||
list-style: none; | ||
margin: 25px 0; | ||
padding: 0; | ||
} | ||
|
||
li { | ||
display: table-cell; | ||
font-weight: bold; | ||
width: 1%; | ||
} | ||
|
||
#suggestions { | ||
margin-top: 35px; | ||
color: #ccc; | ||
} | ||
|
||
#suggestions a { | ||
color: #666666; | ||
font-weight: 200; | ||
font-size: 14px; | ||
margin: 0 10px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
|
||
<h1>404</h1> | ||
<p><strong>There isn't a GitHub Pages site here.</strong></p> | ||
|
||
<p> | ||
Did you mean to visit <a href="//docs.spring-boot-admin.com/">docs.spring-boot-admin.com</a>? | ||
Please note that this site belongs to a GitHub user and is | ||
<strong>not an official GitHub site</strong>. | ||
</p> | ||
|
||
<div id="suggestions"> | ||
<a href="https://github.com/codecentric/spring-boot-admin">@codecentric/spring-boot-admin</a> — | ||
<a href="https://www.codecentric.de">codecentric</a> — | ||
<a href="https://github.com/codecentric/spring-boot-admin/issues">Issues</a> | ||
</div> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters