-
-
Save bovender/efbea6314e7f0e84b4265bba10094942 to your computer and use it in GitHub Desktop.
Ruby on Rails SEO. Add a <link rel="alternate" hreflang="es" href="http://es.example.com/" /> link to every other locale for the same page. Per https://support.google.com/webmasters/answer/189077?hl=en
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-# For each locale except the current one | |
- I18n.available_locales.each do |locale| | |
-# Add a link to the current URL but in `locale` language | |
%link{rel: 'alternate', hreflang: locale, href: url_for(locale: locale, only_path: false)} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment