-
- Downloads
[IMP] website, website_event, website_slides: add rel=canonical tag
The canonical tag is important for SEO, indeed it prevents search engines from indexing duplicate content. Reasoning ========= The choice has been made to create the canonical tag automatically depending on the request path, ignoring the query string, and manually prefixing the appropriate domain and language code. Indeed creating it manually for each resource would create a lot of code and potential mistakes. It is more dangerous to do it the generic way, but after investigation it appears that it is an acceptable trade-off since the vast majority of our routes are well built and already ready for this: - using query string only for minor features that do not change the main content - having the models, the ids, the pager and other important features in the path Override ======== It is still possible to override the default behavior by passing `canonical_params` manually to the view or to the different methods. This is done for `/event` because the only way to display Past Events is to add `date=old`. Languages ========= Fix an issue where it was possible for a bot to be on the URL without language code but to use a language that is not the default language. Adapt hreflang, because it: - must only be present on canonical pages - must always lead to canonical pages - should not be set if there is no alternate language Misc ==== task-1958075 closes #12532 Inspired by OCA module `website_canonical_url` courtesy of Jairo Llopis. closes odoo/odoo#35852 Signed-off-by:Jérémy Kersten (jke) <jke@openerp.com> Co-authored-by:
Jairo Llopis <jairo.llopis@tecnativa.com> Co-authored-by:
Sébastien Theys <seb@odoo.com>
Showing
- addons/http_routing/models/ir_http.py 16 additions, 8 deletionsaddons/http_routing/models/ir_http.py
- addons/website/models/website.py 79 additions, 23 deletionsaddons/website/models/website.py
- addons/website/tests/test_base_url.py 37 additions, 12 deletionsaddons/website/tests/test_base_url.py
- addons/website/views/website_templates.xml 3 additions, 1 deletionaddons/website/views/website_templates.xml
- addons/website_event/controllers/main.py 8 additions, 3 deletionsaddons/website_event/controllers/main.py
- addons/website_event/tests/test_event_website.py 9 additions, 0 deletionsaddons/website_event/tests/test_event_website.py
- addons/website_slides/views/website_slides_templates_homepage.xml 1 addition, 1 deletion...ebsite_slides/views/website_slides_templates_homepage.xml
Loading
Please register or sign in to comment