File tree 4 files changed +47
-2
lines changed
4 files changed +47
-2
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
6
6
7
7
## Unreleased
8
8
9
+ ### Fixed
10
+ - ` core ` Fixed an issue where an unwanted 404 was shown when the styleguide was reloaded on GitHub pages.
11
+
9
12
10
13
## [ 1.0.5] - 2018-11-13
11
14
Original file line number Diff line number Diff line change 20
20
"tsConfig" : " styleguide/tsconfig.app.json" ,
21
21
"assets" : [
22
22
" styleguide/favicon.ico" ,
23
- " styleguide/assets"
23
+ " styleguide/assets" ,
24
+ " styleguide/404.html"
24
25
],
25
26
"styles" : [
26
27
" styleguide/styles.scss" ,
87
88
"scripts" : [],
88
89
"assets" : [
89
90
" styleguide/favicon.ico" ,
90
- " styleguide/assets"
91
+ " styleguide/assets" ,
92
+ " styleguide/404.html"
91
93
]
92
94
}
93
95
},
Original file line number Diff line number Diff line change
1
+ <!doctype html>
2
+ < html lang ="en ">
3
+ < head >
4
+ < meta charset ="utf-8 ">
5
+ < title > Acpaas UI | Angular Modules</ title >
6
+ < script >
7
+ // Store the URL the user was trying to access when receiving the 404.
8
+ sessionStorage . redirect = location . href ;
9
+ </ script >
10
+
11
+ <!-- Immediately redirect to the base URL so we can use the SPA routing. -->
12
+ < meta http-equiv ="refresh " content ="0;URL='/' "> </ meta >
13
+ </ head >
14
+ < body >
15
+ <!-- IE required at least 512 bytes of data to show non-default 404. -->
16
+
17
+
18
+
19
+
20
+
21
+
22
+ </ body >
23
+ </ html >
Original file line number Diff line number Diff line change 15
15
16
16
</ head >
17
17
< body class ="has-header has-navigation ">
18
+ <!-- Github Pages hack to allow SPA refresh without receiving 404. -->
19
+ < script >
20
+ ( function ( ) {
21
+ // Retrieve the URL the user was trying to access when receiving the 404.
22
+ var redirect = sessionStorage . redirect ;
23
+
24
+ // Remove the URL from sessionStorage.
25
+ delete sessionStorage . redirect ;
26
+
27
+ // Check if we actually need to redirect.
28
+ if ( redirect && redirect != location . href ) {
29
+ // We need to redirect to the URL the user was trying to access.
30
+ history . replaceState ( null , null , redirect ) ;
31
+ }
32
+ } ) ( ) ;
33
+ </ script >
34
+ <!-- /Github Pages hack. -->
18
35
< guide-root > </ guide-root >
19
36
</ body >
20
37
</ html >
You can’t perform that action at this time.
0 commit comments