Skip to content

Instantly share code, notes, and snippets.

@samba
Last active November 17, 2016 20:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samba/01c4a07ab73d1bacd23a9f3115e8978c to your computer and use it in GitHub Desktop.
Save samba/01c4a07ab73d1bacd23a9f3115e8978c to your computer and use it in GitHub Desktop.
Jekyll Redirect page template.
<!DOCTYPE html>
<html lang="en-US">
<meta charset="utf-8">
<title>Redirecting…</title>
<link rel="canonical" href="#{item_url}">
<meta http-equiv="refresh" content="0; url=#{item_url}">
<h1>Redirecting…</h1>
<a href="#{item_url}">Click here if you are not redirected.</a>
<script>
q = (location.search && !location.search.indexOf('?')) ? '' : '?';
h = (location.hash && !location.hash.indexOf('#')) ? '' : '#';
location.replace("#{item_url}" + (q + location.search + h + location.hash));
</script>
</html>
@samba
Copy link
Author

samba commented Nov 17, 2016

Proposed update to redirection logic in Jekyll, as per:
jekyll/jekyll-redirect-from#123

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment