Open Graph 和 Twitter 卡片标记用于主题

Hi,

As it is my first topic on that forum, I just want to say thank you for the great product. We in CUBA Platform really love it :slightly_smiling_face:

We make announcements of new features on the forum to give an opportunity to the community to give their feedback on the spot. When I include the link to Discourse topic on Twitter the image is always our logo. Unfortunately, I can’t edit the snippet generated by Twitter, which is luckily not the case for Facebook. As a result, we have lots of tweets with logo, for instance, that one. On Facebook, it looks like that.

I looked through the preferences of our forum and found only fields for the twitter markup for all the pages. So, can I somehow change the twitter card markup for the specified topic?

I believe it should default to the first big image in the post you link to, with fallback to twitter summary large image url.

Is there a way not to include the image in the post but to set it in twitter:image tag?

A custom image only for the post, that isn’t in the post? No that’s not possible.

无法自定义线程的 tweet:card 设置令人失望。如果我们发布一个线程推文,往往会出现用户头像作为图片的情况,而且线程开头的文字通常也无法有效推广该线程。如果能够创建带有大图的摘要卡片(Summary Card with Large Image),将是一个巨大的改进。我知道这条讨论帖已经很旧了,但我找不到其他关于此话题的内容,这让我感到惊讶,因为在 Twitter 上推广网站是吸引新成员极好的方式,而带有自定义卡片的推文通常具有更高的参与度。

目前,在我发布推文之前,我必须先编辑原始帖子(OP),插入一张我喜欢的图片并撰写一段介绍,然后发布推文以加载我想要的图片和文字,最后再撤销我的编辑,将主题恢复到原始状态。如果我想下周再次发布该线程的推文,就必须重复这一整个过程。

这些操作已经远远超出了我的技术能力范围,因此我完全不清楚具体涉及哪些内容。但例如,在 WordPress 上,每个 SEO 插件都允许为每篇帖子设置自定义的 Twitter 卡片和 Open Graph 信息。如果在 Discourse 上也能提供类似选项,将会非常令人感激。

为什么要撤销?如果编辑后的效果更好,那么编辑内容应该保留。

用户不希望管理员介入并修改他们的帖子。提供积极的用户体验比为了优化推文效果而编辑内容更为重要。目前有许多变通方法,例如每次发布推文时更改原始发帖人(OP),或请求用户同意以永久修改帖子,或在帖子线程中间插入新帖子并推文该帖子(Twitter 会抓取该帖子的文本和图片,但链接会将用户导向线程中间,这并非良好的用户体验)。这些方法都不如支持逐线程自定义 Twitter 卡片的功能理想。

此外,据我所知,目前无法为整个线程启用 <meta name="twitter:card" content="summary_large_image">,而不是使用 <meta name="twitter:card" content="summary" />