forked from endoflife-date/endoflife.date
-
Notifications
You must be signed in to change notification settings - Fork 0
/
_redirects
33 lines (30 loc) · 1.05 KB
/
_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
---
# Netlify _redirects template. Documentation can be found on https://docs.netlify.com/routing/redirects/.
#
# The _redirects file is included in _config.yml/include key otherwise Jekyll doesn't copy it to
# _site directory, where Netlify expects it.
#
# To create a new redirect, add an alternate_urls array in the page front-matter.
# Setting a layout forces Jekyll to render this file
layout: null
---
{%- for page in site.pages -%}
# Redirects for {{page.path}}
{%- if page.alternate_urls %}
{%- for url in page.alternate_urls %}
{{url}} {{page.permalink}}
{%- endfor %}
{%- endif %}
{%- if page.layout == 'product' %}
/api{{page.permalink}} /api{{page.permalink}}.json
{%- if page.alternate_urls %}
{%- for url in page.alternate_urls %}
/calendar{{url}}.ics /calendar{{page.permalink}}.ics
/api{{url}}.json /api{{page.permalink}}.json
/api{{url}}/* /api{{page.permalink}}/:splat
{%- endfor %}
{%- endif %}
{%- endif %}
{% endfor %}
# Send API 404 responses in JSON
/api/* /assets/404.json 404