Skip to content

Instantly share code, notes, and snippets.

@AprilSylph
Last active July 4, 2018 09:25
Show Gist options
  • Save AprilSylph/403a1826e64938301b3fcd930f70522e to your computer and use it in GitHub Desktop.
Save AprilSylph/403a1826e64938301b3fcd930f70522e to your computer and use it in GitHub Desktop.
very basic redirect theme for tumblr
<!DOCTYPE html>
<html>
{block:Option}
<meta name="text:Redirect" content="">
{/block:Option}
<head>
{block:IfRedirect}
<title>Redirecting...</title>
<script>
if (location.pathname !== "/customize_preview_receiver.html") {
location.replace("{text:Redirect}" + location.pathname);
}
</script>
<meta name="description" content="This is a redirect to {text:Redirect}."/>
{/block:IfRedirect}
{block:IfNotRedirect}
<title>Unset Redirect</title>
<meta name="description" content="There's nothing here."/>
{/block:IfNotRedirect}
<style>
body {
font-family: Helvetica, Arial, sans-serif;
text-align: center;
margin-top: 25%;
}
p {
margin: 1em;
}
</style>
</head>
<body>
{block:IfNotRedirect}
<p>Hey there! Head back to the options page and set a redirect link. Just be sure not to end URLs in slashes, or it won't work properly!</p>
<p>Since this is a redirect, I also suggest turning off search indexing and instant messaging for this blog to avoid any confusion.</p>
{/block:IfNotRedirect}{block:IfRedirect}
<p>Success! You've set up a redirect from <strong>{BlogURL}*</strong> to <strong>{text:Redirect}/*</strong>.</p>
<p>If you're viewing this from outside the Edit Theme page, turn your scripts back on and reload or just perform the replacement manually, thanks!</p>
{/block:IfRedirect}
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment