Customize the redirect template (#1506)

Fixes #1505

Customize the redirect.html template to perform a client side
javascript redirect that reads the window.location.hash and appends it
to the destination URL, before redirecting.

See https://github.com/jekyll/jekyll-redirect-from/issues/219
This commit is contained in:
Vladimir Piskarev 2022-06-27 16:05:06 +03:00 committed by GitHub
parent 7e7971fca4
commit 7b4ee2073b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

11
_layouts/redirect.html Normal file
View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en-US">
<meta charset="utf-8">
<title>Redirecting&hellip;</title>
<link rel="canonical" href="{{ page.redirect.to }}">
<script>location="{{ page.redirect.to }}".concat(location.hash)</script>
<meta http-equiv="refresh" content="0; url={{ page.redirect.to }}">
<meta name="robots" content="noindex">
<h1>Redirecting&hellip;</h1>
<a href="{{ page.redirect.to }}">Click here if you are not redirected.</a>
</html>