-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathredirects.liquid
35 lines (35 loc) · 1.09 KB
/
redirects.liquid
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
---js
{
pagination: {
data: "collections.all",
size: 1,
alias: "redirect",
before: function (data) {
return data.reduce((redirects, page) => {
if (Array.isArray(page.data.redirect_from)) {
for (let url of page.data.redirect_from) {
redirects.push({ to: page.url, from: url });
}
} else if (typeof page.data.redirect_from === 'string') {
redirects.push({ to: page.url, from: page.data.redirect_from });
}
return redirects;
}, []);
},
addAllPagesToCollections: false,
},
permalink: "{{ redirect.from }}/index.html",
eleventyExcludeFromCollections: true,
}
---
<!DOCTYPE html>
<html lang="en-US">
<meta charset="utf-8">
<title>Redirecting…</title>
<link rel="canonical" href="{{ redirect.to | url }}">
<script>location="{{ redirect.to | url }}"</script>
<meta http-equiv="refresh" content="0; url={{ redirect.to | url }}">
<meta name="robots" content="noindex">
<h1>Redirecting…</h1>
<a href="{{ redirect.to | url }}">Click here if you are not redirected.</a>
</html>