Why would you need this in theme components?
BTW The crawler view already provides JSON-LD for topics.
<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
a 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>