Skip to content

Commit

Permalink
🏗️ Add redirect_to functionality
Browse files Browse the repository at this point in the history
Add functionality to redirect from an internal link to an external URL.
  • Loading branch information
xplosionmind committed Oct 25, 2024
1 parent 1618fe0 commit b47fd54
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions ournet/_data/redirect_to.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from,to
21 changes: 21 additions & 0 deletions ournet/redirect_to.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
pagination:
data: redirect_to
size: 1
alias: redirect
addAllPagesToCollections: false
permalink: '{{ redirect.from }}'
eleventyExcludeFromCollections: true
layout: null
---
<!DOCTYPE html>
<html lang='en' style='background:black;width:100%;height:100%'>
<meta charset='utf-8'>
<title>Redirect to {{ redirect.to }}</title>
<link rel='canonical' href='{{ redirect.to }}'>
<script>location = '{{ redirect.to }}';</script>
<meta http-equiv='refresh' content='0; url={{ redirect.to }}'>
<meta name='robots' content='noindex'>
<h1 style='color:white;text-align:center'>Redirecting to {{ redirect.to }}</h1>
<p><a style='color:mediumspringgreen;text-align:center' href='{{ redirect.to }}'>Click here if you are not being redirected.</a></p>
</html>

0 comments on commit b47fd54

Please sign in to comment.