forked from endoflife-date/endoflife.date
-
Notifications
You must be signed in to change notification settings - Fork 0
/
_redirects
34 lines (25 loc) · 901 Bytes
/
_redirects
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
---
# Setting a layout forces Jekyll to render this file
layout: null
---
{% comment %}
The following loop creates a _redirects file as per
Netlify's syntax: https://docs.netlify.com/routing/redirects/
This also creates a lot of whitespace in the resulting file.
To create a new redirect, add a alternate_urls array in the page front-matter.
The _redirects file is included in _config.yml/include key otherwise
Jekyll doesn't copy it to _site directory, where Netlify expects it.
The Redirect syntax is
/redirect-this /to-that
{% endcomment %}
{% for page in site.pages %}
{% if page.alternate_urls %}
# Redirects for {{page.path}}
{% for url in page.alternate_urls %}
{{url}} {{page.permalink}}
/api{{url}}.json /api{{page.permalink}}.json
/api{{url}}/* /api{{page.permalink}}/:splat
{% endfor %}
{% endif %}
/api{{page.permalink}} /api{{page.permalink}}.json
{% endfor %}