File tree Expand file tree Collapse file tree 3 files changed +53
-0
lines changed Expand file tree Collapse file tree 3 files changed +53
-0
lines changed Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ < html >
3+
4+ < head >
5+ < meta charset ="utf-8 ">
6+ < title > Ahmet Deniz Dündar - Frontend Developer</ title >
7+ < script type ="text/javascript ">
8+ // GitHub Pages hack for single page applications
9+ // Redirect from 404 page to index.html with the route encoded in the query string
10+ var pathSegmentsToKeep = 0 ;
11+ var l = window . location ;
12+ l . replace (
13+ l . protocol + '//' + l . hostname + ( l . port ? ':' + l . port : '' ) +
14+ l . pathname . split ( '/' ) . slice ( 0 , 1 + pathSegmentsToKeep ) . join ( '/' ) + '/?/' +
15+ l . pathname . slice ( 1 ) . split ( '/' ) . slice ( pathSegmentsToKeep ) . join ( '/' ) . replace ( / & / g, '~and~' ) +
16+ ( l . search ? '&' + l . search . slice ( 1 ) . replace ( / & / g, '~and~' ) : '' ) +
17+ l . hash
18+ ) ;
19+
20+ </ script >
21+ </ head >
22+
23+ < body >
24+ <!-- GitHub Pages 404 redirect for Single Page Applications -->
25+ </ body >
26+
27+ </ html >
Original file line number Diff line number Diff line change 218218
219219 </ style >
220220
221+ <!-- GitHub Pages Redirect Script for SPA -->
222+ < script type ="text/javascript ">
223+ // Decode URL parameters from 404.html redirect
224+ ( function ( ) {
225+ var redirect = sessionStorage . redirect ;
226+ delete sessionStorage . redirect ;
227+ if ( redirect && redirect != location . href ) {
228+ history . replaceState ( null , null , redirect ) ;
229+ }
230+ } ) ( ) ;
231+
232+ // Check for redirect parameter in URL
233+ ( function ( ) {
234+ var l = window . location ;
235+ if ( l . search && l . search [ 1 ] === '/' ) {
236+ var decoded = decodeURIComponent ( l . search . slice ( 1 ) ) . split ( '&' ) . map ( function ( s ) {
237+ return s . replace ( / ~ a n d ~ / g, '&' )
238+ } ) . join ( '?' ) ;
239+ window . history . replaceState ( null , null ,
240+ l . pathname . slice ( 0 , - 1 ) + decoded + l . hash
241+ ) ;
242+ }
243+ } ) ( ) ;
244+
245+ </ script >
246+
221247</ head >
222248
223249< body >
You can’t perform that action at this time.
0 commit comments