Skip to content

Commit

Permalink
Add redirects from config
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnaudLigny committed Oct 19, 2020
1 parent 2ea442e commit 7192394
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions layouts/page.netlify_redirects.twig
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
{% for page in site.pages %}{% if page.redirect is defined %}
# Cecil HTML redirects
{% for page in site.pages %}
{% if page.redirect is defined %}
{{ url(page, {'canonical': false}) }} {{ url(page.redirect, {'canonical': false}) }} 301!
{% endif %}{% endfor %}
{% endif %}
{% endfor %}
# Redirects from config
{% if site.netlify.redirects %}
{% for redirect in site.netlify.redirects %}
{{ url(redirect.from, {'canonical': false}) }} {{ url(redirect.to, {'canonical': false}) }}{% if redirect.status %} {{ redirect.status }}{% if redirect.force %}!{% endif %}{% endif %}
{% endfor %}
{% endif %}

0 comments on commit 7192394

Please sign in to comment.