Skip to content

Commit 5115104

Browse files
authored
Merge pull request #214 from gonX/add-discord-toplevel-redirect
Add Discord toplevel redirect
2 parents aaa2173 + 24e5fa0 commit 5115104

2 files changed

Lines changed: 29 additions & 0 deletions

File tree

site/_layouts/redirect.html

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{% if page.redirect == "special_discord" %}
2+
{% assign redirect = site.data.links.project.DiscordInvite %}
3+
{% assign redirect_set = True %}
4+
{% endif %}
5+
{% if redirect_set %}
6+
{% assign redirect = page.redirect | replace: "@@OTD_VERSION@@", site.latest_otd_version %}
7+
{% endif %}
8+
<html>
9+
<head>
10+
<style>
11+
* { background: black; }
12+
</style>
13+
<meta charset="utf-8"/>
14+
<meta http-equiv="refresh" content="1;url={{ redirect }}"/>
15+
<link rel="canonical" href="{{ redirect }}"/>
16+
<script type="text/javascript">
17+
window.location.href = "{{ redirect }}"
18+
</script>
19+
<title>{{ page.title }} Page Redirection</title>
20+
</head>
21+
<body>
22+
If you are not redirected automatically, follow <a href='{{ redirect }}'>this link</a>.
23+
</body>
24+
</html>

site/_sections/Discord.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
title: Discord
3+
layout: redirect
4+
redirect: special_discord
5+
---

0 commit comments

Comments
 (0)