Skip to content

Instantly share code, notes, and snippets.

@ncdc
Last active March 8, 2018 17:23
Show Gist options
  • Save ncdc/8139c00e9f2ae38c26bfcf200b0ee03e to your computer and use it in GitHub Desktop.
Save ncdc/8139c00e9f2ae38c26bfcf200b0ee03e to your computer and use it in GitHub Desktop.
diff --git a/README.md b/README.md
index 03849dc..9f30d51 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
---
permalink: /
redirect_to:
-- /master/
+- LATEST
---
# ark - Docs Branch
diff --git a/_layouts/redirect.html b/_layouts/redirect.html
new file mode 100644
index 0000000..d1d75bf
--- /dev/null
+++ b/_layouts/redirect.html
@@ -0,0 +1,18 @@
+{% assign parts = page.redirect.to | split: "/" %}
+{% assign basename = parts.last %}
+{% if basename == 'LATEST' %}
+ {% assign destination = site.latest | absolute_url %}
+{% else %}
+ {% assign destination = page.redirect.to %}
+{% endif %}
+<!DOCTYPE html>
+<html lang="en-US">
+ <meta charset="utf-8">
+ <title>Redirecting&hellip;</title>
+ <link rel="canonical" href="{{ destination }}">
+ <meta http-equiv="refresh" content="0; url={{ destination }}">
+ <meta name="robots" content="noindex">
+ <h1>Redirecting&hellip;</h1>
+ <a href="{{ destination }}">Click here if you are not redirected.</a>
+ <script>location="{{ destination }}"</script>
+</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment