Merge pull request #85 from madrilene/fix-redirects
redirects same line, use in example post
This commit is contained in:
commit
cf7988da3c
2 changed files with 8 additions and 9 deletions
|
|
@ -3,12 +3,10 @@ permalink: /_redirects
|
||||||
eleventyExcludeFromCollections: true
|
eleventyExcludeFromCollections: true
|
||||||
excludeFromSitemap: true
|
excludeFromSitemap: true
|
||||||
---
|
---
|
||||||
|
{%- for page in collections.all -%}
|
||||||
{% for page in collections.all %}
|
{%- if page.url and page.data.redirectFrom -%}
|
||||||
{% if page.url and page.data.redirectFrom %}
|
{%- for oldUrl in page.data.redirectFrom %}
|
||||||
{% for oldUrl in page.data.redirectFrom %}
|
{{ oldUrl }} {{ page.url }}
|
||||||
{{ oldUrl }}
|
{%- endfor %}
|
||||||
{{ page.url }}
|
{%- endif -%}
|
||||||
{% endfor %}
|
{%- endfor -%}
|
||||||
{% endif %}
|
|
||||||
{% endfor %}
|
|
||||||
|
|
@ -3,6 +3,7 @@ title: 'Post with 301 redirects'
|
||||||
description: 'A 301 is used when a page has permanently changed location. Informing about this change is indispensable if you want to keep a positioning. Aleksandr Hovhannisyan came up with an elegant solution for Eleventy and Netlify.'
|
description: 'A 301 is used when a page has permanently changed location. Informing about this change is indispensable if you want to keep a positioning. Aleksandr Hovhannisyan came up with an elegant solution for Eleventy and Netlify.'
|
||||||
date: 2022-08-28
|
date: 2022-08-28
|
||||||
tags: ['redirects', 'feature']
|
tags: ['redirects', 'feature']
|
||||||
|
redirectFrom: ['/old-route/', '/optionally-another-old-route/']
|
||||||
---
|
---
|
||||||
|
|
||||||
URLs usually change over time, as you use another CMS or optimize your file structure.
|
URLs usually change over time, as you use another CMS or optimize your file structure.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue