discourse/app/views
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
..
about DEV: Add a nofollow to /u so user profiles don't get added as a target for crawling (#30693) 2025-01-13 13:50:00 +08:00
admin/backups
application UX: better error message when social login fails (#32772) 2025-05-20 16:22:38 +02:00
badges
categories
common FEATURE: Append locale to links in crawler view if present (#34466) 2025-08-22 08:46:33 +08:00
default DEV: Show login-required splash in root route (take 2) (#32629) 2025-05-14 11:25:43 -04:00
email DEV: Add a nofollow to /u so user profiles don't get added as a target for crawling (#30693) 2025-01-13 13:50:00 +08:00
embed DEV: Add a nofollow to /u so user profiles don't get added as a target for crawling (#30693) 2025-01-13 13:50:00 +08:00
exceptions UX: Render emojis consistently on 404 page (#34115) 2025-08-06 11:14:23 +01:00
finish_installation FIX: Restore styles in finish-installation route (#34420) 2025-08-19 13:09:28 -04:00
groups
home_page DEV: Show login-required splash in root route (take 2) (#32629) 2025-05-14 11:25:43 -04:00
invites
layouts FEATURE: Append locale to links in crawler view if present (#34466) 2025-08-22 08:46:33 +08:00
list DEV: Add a nofollow to /u so user profiles don't get added as a target for crawling (#30693) 2025-01-13 13:50:00 +08:00
metadata
offline
posts
published_pages
qunit DEV: Reduce surface-area of ThemeJavascriptCompiler API (#33751) 2025-07-23 13:58:29 +01:00
robots_txt
safe_mode
search
session
sitemap
static DEV: Stop using sprockets to compile service-worker js (#31796) 2025-03-13 12:49:33 +00:00
tags
topics FIX: Use correct subcategory subfolder path in crawler (#34250) 2025-08-12 16:14:50 +08:00
user_api_keys UX: Change the authorize button color to primary (#29666) 2024-11-08 17:33:50 -05:00
user_notifications FIX: Move custom digest text to correct spot (#33912) 2025-07-29 10:54:52 -05:00
users DEV: admin-login submit should be a button, not an input (#30156) 2024-12-06 11:48:15 -05:00