请求在主题组件中使用动态的Schema.org

您好,

我希望能够为 Discourse 主题中创建的主题及其回复添加动态 Schema.org JSON-LD。自动生成以下内容的 schema 数据将非常有帮助:

主题:标题、作者和创建日期
回复:作者、回复日期和内容

这将显著提高 SEO 并有助于富搜索结果,使搜索引擎更容易理解主题和回复。

有什么方法可以满足这个要求吗?

谢谢

1 个赞

为什么需要在主题组件中添加这个?

顺便说一句,爬虫视图已经为主题提供了 JSON-LD。

<script type="application/ld+json">
{
   "@context":"http://schema.org",
   "@type":"QAPage",
   "name":"Request for Dynamic Schema.org in Theme Components",
   "mainEntity":{
      "@type":"Question",
      "name":"Request for Dynamic Schema.org in Theme Components",
      "text":"Hi,\n\nI'd like to request the ability to add dynamic <a href=\"http://Schema.org\" rel=\"noopener nofollow ugc\">Schema.org</a> JSON-LD for created topics and their replies in Discourse themes. It would be helpful to automatically generate schem\na data for:\n\nTopic: Title, author, and creation date\n\nReplies: Author, reply date, and content\n\nThis would significantly…",
      "upvoteCount":0,
      "answerCount":0,
      "datePublished":"2025-04-25T05:13:40.289Z",
      "author":{
         "@type":"Person",
         "name":"Aditya_Shevle",
         "url":"https://meta.discourse.org/u/Aditya_Shevle"
      }
   }
}
</script>

4 个赞

您好,

感谢您的回复。但是,当我查看主题页面的源代码时,我看不到任何模式标记。有没有办法启用或添加它?

谢谢。

1 个赞

Discourse 为爬虫提供了一个特殊的视图。由于 JSON-LD 不是供人类使用的,因此它不在常规视图中。

2 个赞