Skip to content

Commit

Permalink
adding discord redirect (CodingTrain#2827)
Browse files Browse the repository at this point in the history
  • Loading branch information
duskvirkus authored Oct 30, 2020
1 parent 738bfba commit 53bdc87
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
6 changes: 6 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ collections:
challenges: { output: true }
learning: { output: true }
more: { output: true }
redirects: { output: true }

# --- Defaults ---

Expand Down Expand Up @@ -192,3 +193,8 @@ defaults:
video_type: "Teachable Machine"
video_type_short: "Tutorial"
can_contribute: true

# Redirects
- scope: { path: "", type: "redirect" }
values:
layout: "external-redirect"
14 changes: 14 additions & 0 deletions _jekyll/layouts/external-redirect.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
layout: base
---

<div class="redirect">
<p>Redirecting you to {{ page.title }}...</p>
<a href="{{ page.redirect_to }}">Click here if you have redirects turned off.</a>
<script>
function redirect() {
window.location.replace("{{ page.redirect_to }}");
}
setTimeout(redirect, 200);
</script>
</div>
6 changes: 6 additions & 0 deletions _redirects/discord.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: Coding Train Discord
redirect_to: "https://discord.gg/hPuGy2g"
redirect_from:
- "/discord"
---

0 comments on commit 53bdc87

Please sign in to comment.