diff --git a/app/views/layouts/_link_rel_alternate.haml b/app/views/layouts/_link_rel_alternate.haml new file mode 100644 index 00000000..64a70977 --- /dev/null +++ b/app/views/layouts/_link_rel_alternate.haml @@ -0,0 +1,7 @@ +- unless current_usuarie + - params.permit! + - I18n.available_locales.each do |locale| + - url = url_for(**params.to_h.merge(change_locale_to: locale), only_path: false) + - if locale == I18n.default_locale + %link{ rel: 'alternate', hreflang: 'x-default', href: url } + %link{ rel: 'alternate', hreflang: locale, href: url } diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 965a856f..d2113398 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -4,7 +4,7 @@ %meta{ charset: 'UTF-8' }/ %meta{ content: 'text/html; charset=UTF-8', 'http-equiv': 'Content-Type' }/ - %meta{ name: 'color-scheme', content: 'light dark' }/ + %meta{ name: 'color-scheme', content: 'light' }/ %meta{ name: 'viewport', content: 'width=device-width, initial-scale=1.0' }/ %meta{ name: 'referrer', content: 'same-origin' }/ @@ -17,6 +17,7 @@ = javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' = stylesheet_pack_tag 'application', 'data-turbolinks-track': 'reload' = favicon_link_tag 'sutty_cuadrada.png', rel: 'apple-touch-icon', type: 'image/png' + = render 'layouts/link_rel_alternate' %body{ class: yield(:body) } .container-fluid#sutty