# Discourse Open Graph

**URL:** <https://meta.discourse.org/t/discourse-open-graph/363183>\
**Category:** Plugin\
**Tags:** experimental\
**Created:** [2025 年 4 月 23 日午後 4:57 UTC](https://meta.discourse.org/t/discourse-open-graph/363183 "2025-04-23T16:57:21Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![gabriel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gabriel/32/367911_2.png) [@gabriel](https://meta.discourse.org/u/gabriel)\
**Post date:** [2025 年 4 月 28 日午後 2:51 UTC](https://meta.discourse.org/t/discourse-open-graph/363183/3 "2025-04-28T14:51:18Z")

</div>

> [@jimkleiber](#):
>
> これはトピックにも機能しますか？

機能すると思いますが、トピックごとにオーバーライドを追加する必要があります。

おそらく、これはAIトピックサマリーの機能になるでしょう。トピック自体にAIサマリーがある場合にメタデータコンテンツをオーバーライドできます。

いくつかの疑似コードです。[Open Graphプラグインのこのスニペットに触発されました](https://github.com/discourse/discourse-open-graph/blob/e9a0c5179c260236caf106d9875ad46c9e2e531d/plugin.rb#L21-L29):

```rb
  register_modifier(:meta_data_content) do |content, property, opts|
    next content if property == :url # URLをオーバーライドしたくありません
    url = opts[:url]
    override = Topic.find_by_url(url)[:ai_meta_data_override]
    if override
      content = override[property] if override[property] # :title または :description のいずれかになります
    end
    content
  end

```

---

_[View the full topic](https://meta.discourse.org/t/discourse-open-graph/363183)._
