Elixirschool: Deal with redirect_from directive in a better way

Created on 23 Apr 2018  路  5Comments  路  Source: elixirschool/elixirschool

When we decided to move English language lessons from https://elixirschool.com/lessons/ to https://elixirschool.com/en/lessons/
we added the redirect_from directive to every lesson.
for example
en/lessons/advanced/typespec/ has this frontmatter:

---
version: 1.0.2
title: Specifications and types
redirect_from:
  - /lessons/advanced/typespec/
---

the problem with this is that when people translate the page, they leave that as it is, and there is one URL that redirects to two different language versions, so the old link is randomly taken over.

My suggestion for the time being is:

  1. add a warning in the README file to remove every occurrence of redirect_from
  2. remember when reviewing the lessons added, that it cannot contain a redirect_from (I just approved one today and totally overlooked ay this)
  3. add a comment before the redirect_from directive asking translators to remove it, such as this for example:
---
version: 1.0.2
title: Specifications and types
# PLEASE remove the `redirect_from` directive below if you are translating this lesson
redirect_from:
  - /lessons/advanced/typespec/
---

/cc @elixirschool/developers

bug discussion

Most helpful comment

I will tackle this

All 5 comments

Thanks for bringing this up @eksperimental. I think #3 would be the easiest. If we want an excuse to write some Elixir an MVP review bot could check for redirect_from and version updates (or lack thereof).

Since only the old English lessons require redirects maybe it makes sense to use redirect_to in the former paths instead? Then the lessons themselves won't have any unrelated parts in front matter and there would be nothing to be accidentally copied into translations.

True! why haven't we thought of that before

I will tackle this

Wonderful, thank you @eksperimental!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

brain-geek picture brain-geek  路  4Comments

roberthopman picture roberthopman  路  3Comments

swissarmybox picture swissarmybox  路  4Comments

sotojuan picture sotojuan  路  4Comments

skanel picture skanel  路  4Comments