generated from itw-creative-works/ultimate-jekyll
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
161 changed files
with
558 additions
and
1,530 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
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
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
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,24 @@ | ||
<!-- 404 page helper --> | ||
<script> | ||
Manager.ready(function () { | ||
var url = new URL(window.location.href); | ||
var qs404Fixer = url.searchParams.get('404Fixer'); | ||
|
||
// Report | ||
Manager.sentry().captureException(new Error('404 at: ' + window.location.href)); | ||
|
||
// If pathname ends with trailing slash, remove it and reload | ||
if (url.pathname.match(/\/$/) && !qs404Fixer) { | ||
url.pathname = url.pathname.replace(/\/$/, ''); | ||
url.searchParams.set('404Fixer', 'trailing-slash'); | ||
|
||
// Log | ||
console.log('Redirecting to: ' + url.toString()); | ||
|
||
// Redirect | ||
setTimeout(function () { | ||
window.location.href = url.toString(); | ||
}, 300); | ||
} | ||
}) | ||
</script> |
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
Oops, something went wrong.