Get right title embedding comments

Using the code to embedding comments always get the same title topic. # Embedding Discourse Comments via Javascript

How could set the correct title for topic? How discourse get the topic title of a page? using the tag title of the head or other way?


1 Like

Yes, page is parsed with Nokogiri and the title tag extracted.

Can you share a link of the article that was imported with the wrong title?

1 Like

I found that the problem is with my web page, because we use Vue and dynamic routes… and discourse only is getting the index one…

We have to fix it first.

Thanks! :smiley:

1 Like

Our crawler, like most, doesn’t execute Javascript.

Your options would be to either:

  • Add some sort of SSR. Either locally or with some tool like

  • Change Discourse integration from the JS method, to one where you call our API and create the topics with it, having full control over the content. After that, you can use the same JS comments component but pass the pre-created topic ID so it will link the two.