Make sure to add hreflang on localized pages. - #164
Conversation
|
replacing deprecated calls should be sent in a separate PR rather than being mixed with a new feature. Replacing deprecated calls probably requires less discussions than a new feature, and mixing both makes it harder to review the new feature |
There was a problem hiding this comment.
RequestStack is not supported on the Symfony 2.3 LTS
There was a problem hiding this comment.
Sorry, you are correct. Should I get the request from the TwigEnvironment instead?
|
Thank you @acasademont for taking time to review this. I have now rebased the code. What do you think about using the twig environment instead of injecting the |
|
@Nyholm You need to fix the tests as well. |
|
I've updated this PR. It supports SF2.3 and the tests are fixed. |
|
@Nyholm Have you also checked the jms_i18n_routing:
locales: [nl, en, fr]not_french:
path: /not-french
options: { i18n_locales: [nl, en] }This should ignore the |
|
You also need to add twig to composer.json. |
|
Thank you @XWB for your feedback. I had not considered the scenario where you do not use all locales. I have rewritten the PR according to your comments. |
|
Up ? |
This introduces a twig function
hreflangthat will print<link rel="alternate" hreflang="es" href="http://es.example.com/" />on all pages that are localized.I do also remove calls to deprecated functions.