New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deal with redirect_from directive in a better way #1397
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 |
Since only the old English lessons require redirects maybe it makes sense to use |
True! why haven't we thought of that before |
I will tackle this |
Wonderful, thank you @eksperimental! |
It creates a .md file with the "redirect_to" directive for every lesson, in order to avoid translators to copy the "redirect_from" directive Closes elixirschool#1397 Script for creating the new redirect files for d in $( ls -1 en/lessons/ ); do mkdir -p lessons/${d} for f in $( ls -1 en/lessons/${d}/ | sed -e 's/\..*$//' ); do echo -e "---\nredirect_to:\n - /en/lessons/${d}/${f}/\n---" > lessons/${d}/${f}.md; done done
It creates a .md file with the "redirect_to" directive for every lesson, in order to avoid translators to copy the "redirect_from" directive Closes #1397 Script for creating the new redirect files for d in $( ls -1 en/lessons/ ); do mkdir -p lessons/${d} for f in $( ls -1 en/lessons/${d}/ | sed -e 's/\..*$//' ); do echo -e "---\nredirect_to:\n - /en/lessons/${d}/${f}/\n---" > lessons/${d}/${f}.md; done done
It creates a .md file with the "redirect_to" directive for every lesson, in order to avoid translators to copy the "redirect_from" directive Closes #1397 Script for creating the new redirect files for d in $( ls -1 en/lessons/ ); do mkdir -p lessons/${d} for f in $( ls -1 en/lessons/${d}/ | sed -e 's/\..*$//' ); do echo -e "---\nredirect_to:\n - /en/lessons/${d}/${f}/\n---" > lessons/${d}/${f}.md; done done
It creates a .md file with the "redirect_to" directive for every lesson, in order to avoid translators to copy the "redirect_from" directive Closes #1397 Script for creating the new redirect files for d in $( ls -1 en/lessons/ ); do mkdir -p lessons/${d} for f in $( ls -1 en/lessons/${d}/ | sed -e 's/\..*$//' ); do echo -e "---\nredirect_to:\n - /en/lessons/${d}/${f}/\n---" > lessons/${d}/${f}.md; done done
It creates a .md file with the "redirect_to" directive for every lesson, in order to avoid translators to copy the "redirect_from" directive Closes #1397 Script for creating the new redirect files for d in $( ls -1 en/lessons/ ); do mkdir -p lessons/${d} for f in $( ls -1 en/lessons/${d}/ | sed -e 's/\..*$//' ); do echo -e "---\nredirect_to:\n - /en/lessons/${d}/${f}/\n---" > lessons/${d}/${f}.md; done done
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: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:
/cc @elixirschool/developers
The text was updated successfully, but these errors were encountered: