discourse/app/views/layouts
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
..
_head.html.erb DEV: Make interactive-widget viewport config chrome-only (#30889) 2025-01-21 09:46:18 +00:00
_noscript_footer.html.erb UX: Rename FAQ to Guidelines (#27451) 2024-06-13 12:09:53 -03:00
_noscript_header.html.erb DEV: Add site description to crawler homepage view (#32845) 2025-05-22 08:33:59 +10:00
application.html.erb DEV: Load admin JS bundles from plugins for staff users (#33540) 2025-07-10 07:39:11 +03:00
crawler.html.erb FEATURE: Append locale to links in crawler view if present (#34466) 2025-08-22 08:46:33 +08:00
email_template.html.erb Revert "Revert "Merge branch 'master' of https://github.com/discourse/discourse"" 2020-05-23 00:56:13 -04:00
embed.html.erb DEV: Replace break_string.js with CSS in embedded view (#32488) 2025-04-28 10:47:27 +01:00
ember_cli.html.erb DEV: Stop using sprockets for 'use ember cli' stylesheet (#28633) 2024-08-29 10:38:27 +01:00
finish_installation.html.erb UX: add color-scheme meta tag to _head (#30245) 2024-12-13 08:10:08 -03:00
no_ember.html.erb FEATURE: Add experimental tracking of 'real browser' pageviews (#26647) 2024-04-25 11:00:01 +01:00
publish.html.erb FEATURE: support adobe analytics tags tracking (#30433) 2024-12-26 15:25:48 +05:30