discourse/app/views/common
Natalie Tay ced7833cd0
FEATURE: Append locale to links in crawler view if present (#34466)
This applies the following when
`SiteSetting.content_localization_enabled &&
SiteSetting.content_localization_crawler_param` and in crawler view.
- note: `content_localization_crawler_param` is an experimental site
setting
- attaches the following in crawler view, depending on the values in
`SiteSetting.content_localization_supported_locales`, assuming en, ja,
ko.
([old](https://developers.google.com/search/blog/2013/04/x-default-hreflang-for-international-pages)
but likely relevant)
```
      <link rel="alternate" href="https://nat-1.demo-by-discourse.com/" hreflang="x-default">
      <link rel="alternate" href="https://nat-1.demo-by-discourse.com/?tl=en" hreflang="en">
      <link rel="alternate" href="https://nat-1.demo-by-discourse.com/?tl=ja" hreflang="ja">
      <link rel="alternate" href="https://nat-1.demo-by-discourse.com/?tl=ko" hreflang="ko">
```
- appends the `tl` param based on the presence of it in the incoming
request
- this method puts every response for crawler requests through Nokogiri
parse.. so we'll have to see how this goes in practice
  
 ### Video
 
In the following video you can see each page has the code chunk above in
`head`, and each navigated page has the appropriate appended URL param.


/t/160415
2025-08-22 08:46:33 +08:00
..
_discourse_preload_stylesheet.html.erb DEV: Compile 'common' CSS into own assets (#31416) 2025-05-01 10:44:49 +01:00
_discourse_publish_stylesheet.html.erb FIX: Include common_theme CSS in published pages (#33179) 2025-06-12 19:07:48 +01:00
_discourse_splash.html.erb FEATURE: Dark/light mode selector (#31086) 2025-02-07 03:28:34 +03:00
_discourse_stylesheet.html.erb DEV: Compile and serve rtl versions of theme CSS (#32881) 2025-05-23 13:48:57 +01:00
_google_tag_manager_body.html.erb
_google_tag_manager_head.html.erb FEATURE: Add experimental option for strict-dynamic CSP (#25664) 2024-02-16 11:16:54 +00:00
_google_universal_analytics.html.erb FEATURE: Add experimental option for strict-dynamic CSP (#25664) 2024-02-16 11:16:54 +00:00
_hreflang_tags.html.erb FEATURE: Append locale to links in crawler view if present (#34466) 2025-08-22 08:46:33 +08:00
_second_factor_backup_input.html.erb FIX: Allow the app to generate and accept longer backup codes (#8761) 2020-01-21 14:28:31 +00:00
_second_factor_text_field.html.erb FEATURE: Second factor backup 2018-06-28 10:12:32 +02:00