2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-10-03 17:21:20 +08:00
discourse/app/helpers
Natalie Tay a9b1fb9b43
Some checks are pending
Licenses / run (push) Waiting to run
Linting / run (push) Waiting to run
Publish Assets / publish-assets (push) Waiting to run
Tests / core backend (push) Waiting to run
Tests / plugins backend (push) Waiting to run
Tests / core frontend (Chrome) (push) Waiting to run
Tests / plugins frontend (push) Waiting to run
Tests / themes frontend (push) Waiting to run
Tests / core system (push) Waiting to run
Tests / plugins system (push) Waiting to run
Tests / themes system (push) Waiting to run
Tests / core frontend (Firefox ESR) (push) Waiting to run
Tests / core frontend (Firefox Evergreen) (push) Waiting to run
Tests / chat system (push) Waiting to run
Tests / merge (push) Blocked by required conditions
FIX: Add ld+json VideoObject to each lazy video (#34678)
Lazily loaded videos currently won't be picked up by search engines as
they do not contain an iframe or VideoObject.

This commit uses a new API `build_plugin_html
"server:topic-show-crawler-post-end"` to insert populated
[ld+json](https://developers.google.com/search/docs/appearance/structured-data/intro-structured-data#supported-formats)
into the end of each post which has a video.

Results:
-
https://search.google.com/test/rich-results/result?id=vegb8Qkz7HThsMbFaeN2AQ
-
https://search.google.com/test/rich-results/result?id=asumX41RneM2tMstchv45A
- (vimeo)
https://search.google.com/test/rich-results/result?id=EZWOMJCkDqEQIHfOLkSkcw

Note: 

There were originally two ways around this 
- add each VideoObject to the `post.cook` all the time agnostic of
crawler view
- or add them to the `<head>` with appropriate metadata, needing to
duplicate all post meta data within a `isPartOf` attribute.

I chose to create a new api so that we can satisfy both "only add the
meta data in crawler view" and prevent post metadata duplication.
2025-09-03 22:01:14 +08:00
..
application_helper.rb FIX: Add ld+json VideoObject to each lazy video (#34678) 2025-09-03 22:01:14 +08:00
common_helper.rb Revert "DEV: Remove the word tags from adobe_analytics_tags_url" (#32490) 2025-04-28 22:46:28 +08:00
email_helper.rb DEV: update base url links to respect subfolder installs (#27740) 2024-07-09 12:42:38 +04:00
embed_helper.rb UX: Use localized time format in embedded comments (#28014) 2024-07-22 18:42:36 +08:00
emoji_helper.rb FEATURE: Render emojis on GitHub labels when oneboxing an issue. (#13531) 2021-06-25 14:48:36 -03:00
list_helper.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
posts_helper.rb DEV: Apply syntax_tree formatting to app/* 2023-01-09 14:14:59 +00:00
qunit_helper.rb DEV: Use rollup for theme JS compilation (#33103) 2025-07-25 12:02:29 +01:00
topic_post_bookmarkable_helper.rb DEV: Apply syntax_tree formatting to app/* 2023-01-09 14:14:59 +00:00
topics_helper.rb FEATURE: Localize topic view in crawler view (#34253) 2025-08-13 16:38:07 +08:00
user_notifications_helper.rb DEV: Refactors digest/summary email into partials (#33451) 2025-07-07 09:57:15 -05:00