0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-06 13:08:40 +08:00
discourse/lib
Penar Musaraj 2d895de297
FEATURE: generated OpenGraph images for topics (#39194)
Adds the ability to automatically generate Open Graph images for topics
that don't have their own image. When enabled via the
generate_topic_og_image site setting, a background job creates a branded
1200×630 PNG for each new topic OP.

Key changes:
- TopicOgImageGenerator builds an SVG and converts it to PNG via
ImageMagick
  - Images generated via GenerateTopicOgImage Sidekiq job
- Generated images handled via og_image_upload_id column on the topics
table
- TopicView#image_url falls back to the generated OG image when no topic
image is available

This includes a preview for admins so they can see if they like this
feature or not:


https://github.com/user-attachments/assets/62d17704-4ee5-4859-ac37-b127fe27b85c


And it also respects the site's default theme: 

<img width="1200" height="630" alt="image"
src="https://github.com/user-attachments/assets/678f5c5d-e593-4385-b800-141196dfc221"
/>

---------

Co-authored-by: discourse-patch-triage[bot] <272280883+discourse-patch-triage[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Grubba <gabriel@discourse.org>
2026-06-26 10:37:10 -04:00
..
action_dispatch/session
active_support_type_extensions
admin_dashboard/reports DEV: Let plugins exclude reports from the customisable dashboard (#40463) 2026-06-03 16:36:01 +03:00
auth
autospec
backup_restore FIX: Never use structure.sql when restoring a backup (#41164) 2026-06-24 12:35:12 +01:00
common_passwords
compression FIX: ZIP symlink entries are extracted as real directories (#41168) 2026-06-25 11:16:17 -03:00
content_localization FEATURE: Localize local oneboxes (#40493) 2026-06-08 11:49:55 +08:00
content_security_policy FIX: Allow CDN asset host in worker-src CSP (#40871) 2026-06-15 10:31:38 +01:00
demon
discourse FEATURE: Route all GitHub API requests through one rate-limited client (#40637) 2026-06-15 10:59:10 +02:00
discourse_dev
discourse_webauthn
email FEATURE: Add PM whisper feedback for email sending failures (#40250) 2026-05-22 17:17:15 -03:00
email_controller_helper
emoji
faker
file_store PERF: Run primary and parallel DB setup concurrently in CI (#40319) 2026-05-29 06:46:32 +08:00
final_destination
freedom_patches DEV: Replace JS build system with Rolldown (#35963) 2026-05-29 11:11:55 +01:00
generators
guardian FEATURE: Localizable /about page fields via its settings page (#41123) 2026-06-26 20:41:08 +08:00
i18n
import
import_export
middleware DEV: Track beacon browser pageviews behind dashboard_improvements (#40934) 2026-06-23 10:21:39 +08:00
migration DEV: Rename anonymous group to anonymous_users (#40435) 2026-06-02 09:29:46 +10:00
nested_replies
onebox FEATURE: add Google Meet oneboxes (#41018) 2026-06-18 15:49:43 +10:00
plugin FIX: Include rollup file hash in plugin entrypoint filenames (#40853) 2026-06-15 09:24:28 +01:00
pretty_text
rate_limiter
release_utils
request_tracker/rate_limiters
reviewable FIX: Resolve all of a deleted spammer's reviewables (#40780) 2026-06-15 13:34:15 +08:00
scheduler
search
second_factor DEV: Split passkey and security key WebAuthn ceremonies for 2FA (#40817) 2026-06-17 12:52:47 -03:00
seed_data DEV: Persist dashboard configuration in table and *not* on closure of the dialog (#40546) 2026-06-04 10:53:59 +08:00
service Revert "FEATURE: discourse-workflows (#39704)" (#40366) 2026-05-28 13:59:42 +01:00
sidekiq
site_settings DEV: Add hide_settings metadata to upcoming changes framework (#40990) 2026-06-19 10:25:39 +04:00
stylesheet DEV: Refresh all plugin stylesheet targets on change (#40448) 2026-06-01 18:11:39 +01:00
tasks FIX: Never use structure.sql when restoring a backup (#41164) 2026-06-24 12:35:12 +01:00
theme_settings_manager
theme_store FEATURE: Show theme d-compat/* refs in admin UI (#40649) 2026-06-17 22:13:45 +01:00
topic_query
topic_view
turbo_tests DEV: Add per-test SQL/Redis/network capture RSpec formatter (#40632) 2026-06-16 09:47:54 +08:00
upcoming_changes DEV: Tweaks to upcoming change status bump workflow (#40784) 2026-06-12 07:49:07 +10:00
validators FEATURE: Log in with a one-time email code (#40804) 2026-06-17 12:34:48 -07:00
wizard
admin_confirmation.rb
admin_constraint.rb
admin_user_index_query.rb
age_words.rb
anonymous_action.rb FEATURE: Prompt anonymous users to sign up after engagement clicks (#40256) 2026-05-26 09:30:38 +02:00
application_layout_preloader.rb PERF: Move theme settings from js bundle to preload data (#40137) 2026-06-08 16:04:56 +01:00
archetype.rb
asset_processor.rb DEV: Restore data-test-* stripping (#40980) 2026-06-18 09:19:56 +01:00
auth.rb
backup_restore.rb
badge_posts_view_manager.rb
badge_queries.rb
base62.rb
bookmark_manager.rb
bookmark_query.rb
bookmark_reminder_notification_handler.rb
bookmarks_bulk_action.rb
browser_detection.rb
browser_pageview_referrer_inspector.rb FIX: Backfill normalized referrer for historical browser pageviews (#40357) 2026-06-09 09:04:57 +08:00
cache.rb
canonical_url.rb
category_badge.rb
chrome_installed_checker.rb
color_math.rb
comment_migration.rb
common_passwords.rb
composer_messages_finder.rb FIX: Show composer education message once per session (#41124) 2026-06-23 12:19:42 -03:00
configurable_urls.rb
content_buffer.rb
content_localization.rb
content_security_policy.rb
cooked_post_processor.rb FEATURE: generated OpenGraph images for topics (#39194) 2026-06-26 10:37:10 -04:00
cooked_processor_mixin.rb FEATURE: Localize local oneboxes (#40493) 2026-06-08 11:49:55 +08:00
crawler_detection.rb
crawler_scorer.rb DEV: Track beacon browser pageviews behind dashboard_improvements (#40934) 2026-06-23 10:21:39 +08:00
csrf_token_verifier.rb
current_user.rb FEATURE: Prompt anonymous users to sign up after engagement clicks (#40256) 2026-05-26 09:30:38 +02:00
custom_renderer.rb
db_helper.rb
dev_log_formatter.rb
directory_helper.rb
discourse.rb DEV: Rename EmberCli to EmberAssets (#40938) 2026-06-16 12:56:56 +02:00
discourse_connect_base.rb FIX: Reject DiscourseConnect SSO payloads when secret is blank (#40830) 2026-06-12 15:17:16 +03:00
discourse_connect_provider.rb
discourse_dev.rb
discourse_diff.rb
discourse_event.rb
discourse_gifs.rb DEV: check for author repo in gifs component installed (#41050) 2026-06-19 16:39:20 +04:00
discourse_hub.rb
discourse_id.rb
discourse_ip_info.rb FIX: Add reverse DNS timeout to DiscourseIpInfo (#40593) 2026-06-05 12:29:51 +08:00
discourse_lograge.rb
discourse_logstash_logger.rb
discourse_plugin_registry.rb DEV: Refresh all plugin stylesheet targets on change (#40448) 2026-06-01 18:11:39 +01:00
discourse_redis.rb
discourse_tagging.rb FIX: Allow managing restricted tags in bulk actions (#40681) 2026-06-24 18:30:35 +02:00
discourse_updates.rb FEATURE: Improve display of installed/available version on dashboard (#41165) 2026-06-24 13:07:05 +01:00
discourse_webauthn.rb DEV: Split passkey and security key WebAuthn ceremonies for 2FA (#40817) 2026-06-17 12:52:47 -03:00
disk_cache_eviction.rb
disk_space.rb
distributed_cache.rb
distributed_memoizer.rb
distributed_mutex.rb
edit_rate_limiter.rb
email.rb
email_backup_token.rb
email_cook.rb
email_templates_finder.rb
email_updater.rb
embed_mode_handler.rb FIX: Apply embed class_name to <html> in full app mode (#40344) 2026-05-27 17:31:03 -03:00
ember_assets.rb DEV: Rename EmberCli to EmberAssets (#40938) 2026-06-16 12:56:56 +02:00
encodings.rb
enum.rb
enum_site_setting.rb
excerpt_parser.rb
external_upload_helpers.rb
feed_element_installer.rb
feed_item_accessor.rb
file_helper.rb
filter_best_posts.rb
final_destination.rb
flag_query.rb
flag_settings.rb
gaps.rb
gc_stat_instrumenter.rb
git_repo.rb
git_url.rb
git_utils.rb
github_rate_limit.rb FEATURE: Route all GitHub API requests through one rate-limited client (#40637) 2026-06-15 10:59:10 +02:00
global_path.rb
group_lookup.rb
group_manager.rb
guardian.rb DEV: Rename anonymous group to anonymous_users (#40435) 2026-06-02 09:29:46 +10:00
has_errors.rb
highlight_js.rb
hijack.rb
homepage_constraint.rb
homepage_helper.rb
html_prettify.rb
html_to_markdown.rb
http_language_parser.rb
http_user_agent_encoder.rb
ical_encoder.rb
image_sizer.rb
impersonator_constraint.rb
import_export.rb
inline_oneboxer.rb FEATURE: Route all GitHub API requests through one rate-limited client (#40637) 2026-06-15 10:59:10 +02:00
job_time_spacer.rb
js_locale_helper.rb DEV: Replace JS build system with Rolldown (#35963) 2026-05-29 11:11:55 +01:00
json_error.rb
letter_avatar.rb
localization_attributes_replacer.rb
localized_cooked_post_processor.rb FEATURE: Localize local oneboxes (#40493) 2026-06-08 11:49:55 +08:00
markdown_linker.rb
mem_info.rb
message_bus_diags.rb
method_profiler.rb DEV: Add per-test SQL/Redis/network capture RSpec formatter (#40632) 2026-06-16 09:47:54 +08:00
mini_scheduler_long_running_job_logger.rb
mini_sql_multisite_connection.rb
mobile_detection.rb UX: Drop legacy mobile-mode site settings (#40226) 2026-05-26 09:23:13 +01:00
nested_replies.rb
new_post_manager.rb
new_post_result.rb
notification_levels.rb
onebox.rb
oneboxer.rb FEATURE: add Google Meet oneboxes (#41018) 2026-06-18 15:49:43 +10:00
onpdiff.rb
password_hasher.rb
pbkdf2.rb
permalink_constraint.rb
pinned_check.rb
pitchfork_logstash_patch.rb
plain_text_to_markdown.rb
plugin.rb
plugin_gem.rb
post_action_creator.rb
post_action_destroyer.rb
post_action_result.rb
post_action_type_view.rb
post_creator.rb FEATURE: Exclude small actions from topic counters and unread tracking (#40481) 2026-06-08 08:03:55 +02:00
post_destroyer.rb FEATURE: Exclude small actions from topic counters and unread tracking (#40481) 2026-06-08 08:03:55 +02:00
post_jobs_enqueuer.rb
post_localization_creator.rb
post_localization_destroyer.rb
post_localization_updater.rb
post_locker.rb
post_merger.rb
post_revisor.rb FIX: Allow selecting synonyms in composer tag chooser (#39974) 2026-05-22 18:47:59 +02:00
posts_filter.rb FEAT: Support excluding topics in posts filters (#41216) 2026-06-26 13:56:36 +10:00
presence_channel.rb FIX: Don't auto-remove chat members from logged_in_users group (#40543) 2026-06-03 18:15:32 +02:00
pretty_text.rb FEATURE: Allow HTML for OAuth error message (#41204) 2026-06-26 08:35:06 -05:00
promotion.rb
quote_comparer.rb
quote_rewriter.rb
rake_helpers.rb
rate_limiter.rb
read_only_mixin.rb
release_utils.rb
require_dependency_backward_compatibility.rb
retrieve_title.rb
route_format.rb
route_matcher.rb
rtl.rb
s3_cors_rulesets.rb
s3_helper.rb PERF: Run primary and parallel DB setup concurrently in CI (#40319) 2026-05-29 06:46:32 +08:00
s3_inventory.rb
schema_settings_object_validator.rb
score_calculator.rb
screening_model.rb
search.rb
secure_upload_endpoint_helpers.rb
server_session.rb
service.rb
shrink_uploaded_image.rb
sidekiq_logster_reporter.rb
sidekiq_long_running_job_logger.rb
signal_trap_logger.rb
site_icon_manager.rb
site_setting_extension.rb FEATURE: Localizable /about page fields via its settings page (#41123) 2026-06-26 20:41:08 +08:00
slug.rb
smtp_provider_overrides.rb
socket_server.rb
spam_handler.rb
staff_constraint.rb
staff_message_format.rb
statistics.rb
suggested_topics_builder.rb FIX: Suggested topic links to nested replies topics (#40302) 2026-05-26 08:40:38 -05:00
svg_sprite.rb UX: Update share icon (#40999) 2026-06-18 14:22:12 -04:00
system_message.rb
system_themes_manager.rb
tag_localization_creator.rb
tag_localization_destroyer.rb
tag_localization_updater.rb
temporary_db.rb DEV: Adds a check for the Arch AUR legacy postgresql packages bin path to temporary_db script (#40373) 2026-05-28 11:49:18 -05:00
temporary_redis.rb
text_cleaner.rb
text_sentinel.rb
theme_javascript_compiler.rb FIX: Include rollup file hash in plugin entrypoint filenames (#40853) 2026-06-15 09:24:28 +01:00
theme_metadata.rb
theme_modifier_helper.rb
theme_resolver.rb
theme_screenshots_handler.rb
theme_settings_manager.rb
theme_settings_parser.rb
theme_settings_validator.rb
theme_site_setting_resolver.rb
theme_translation_manager.rb
theme_translation_parser.rb
timeline_lookup.rb
tiny_japanese_segmenter.rb
top_menu.rb FEATURE: Add upcoming change for unified new view (#40631) 2026-06-09 11:34:22 +10:00
topic_creator.rb
topic_list_responder.rb
topic_localization_creator.rb
topic_localization_destroyer.rb
topic_localization_updater.rb
topic_og_image_generator.rb FEATURE: generated OpenGraph images for topics (#39194) 2026-06-26 10:37:10 -04:00
topic_publisher.rb
topic_query.rb FEATURE: Add upcoming change for unified new view (#40631) 2026-06-09 11:34:22 +10:00
topic_query_params.rb
topic_retriever.rb
topic_subtype.rb
topic_upload_security_manager.rb
topic_view.rb FEATURE: generated OpenGraph images for topics (#39194) 2026-06-26 10:37:10 -04:00
topics_bulk_action.rb FIX: Allow managing restricted tags in bulk actions (#40681) 2026-06-24 18:30:35 +02:00
topics_filter.rb FIX: Support status:noreplies and status:single_user on the /filter route (#40371) 2026-05-28 20:03:42 +02:00
truncate_logs_formatter.rb
trust_level.rb
turbo_tests.rb
twitter_api.rb
unread.rb
upcoming_changes.rb DEV: Add hide_settings metadata to upcoming changes framework (#40990) 2026-06-19 10:25:39 +04:00
upload_creator.rb FEATURE: generated OpenGraph images for topics (#39194) 2026-06-26 10:37:10 -04:00
upload_markdown.rb FIX: Prevent backslash accumulation in upload markdown labels (#39461) 2026-06-03 18:10:38 +02:00
upload_recovery.rb
upload_security.rb
url_helper.rb
user_comm_screener.rb
user_lookup.rb
user_name_suggester.rb
vary_header.rb
version.rb DEV: Begin development of v2026.6.0-latest (#40362) 2026-05-28 10:56:24 +02:00
version_compatibility.rb FEATURE: Show theme d-compat/* refs in admin UI (#40649) 2026-06-17 22:13:45 +01:00
wizard.rb
work_queue.rb
xml_cleaner.rb