File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change 1
1
var currentUrl = window . location . href ;
2
2
var newUrl = currentUrl ;
3
3
4
- if ( currentUrl . endsWith ( "index.html" ) || currentUrl . endsWith ( "index" ) ) {
5
- newUrl = currentUrl . replace ( / i n d e x \. h t m l $ | i n d e x $ / , '' ) ;
6
- } else if ( window . location . pathname . endsWith ( ".html" ) ) {
7
- newUrl = currentUrl . replace ( / \. h t m l $ / , '' ) ;
8
- }
4
+ if ( currentUrl . includes ( "github.io" ) ) {
5
+ if ( currentUrl . endsWith ( "index.html" ) || currentUrl . endsWith ( "index" ) ) {
6
+ newUrl = currentUrl . replace ( / i n d e x \. h t m l $ | i n d e x $ / , '' ) ;
7
+ } else if ( window . location . pathname . endsWith ( ".html" ) ) {
8
+ newUrl = currentUrl . replace ( / \. h t m l $ / , '' ) ;
9
+ }
9
10
10
- if ( newUrl !== currentUrl ) {
11
- window . history . replaceState ( null , null , newUrl ) ;
11
+ if ( newUrl !== currentUrl ) {
12
+ window . history . replaceState ( null , null , newUrl ) ;
13
+ }
12
14
}
13
15
14
-
15
16
const typedTitle = document . getElementById ( 'typed-text' ) ;
16
17
const typedDescription = document . getElementById ( 'typed-description' ) ;
17
18
const buttons = document . querySelector ( '.buttons' ) ;
You can’t perform that action at this time.
0 commit comments