The only way that I have seen for embedding comments in a static site through Discourse is the one described in this blog: Embedding Discourse in Static Sites - Evil Trout’s Blog
However I find that approach a bit complicated, and having many assumptions/restrictions that don’t fit many users. At least it does not work for me, it does not work the way that I want.
A better approach in my opinion would be to build a plugin that works as described below.
On the page that embeds the comments we include code like this (not generated by the plugin):
One of the problems with the code above is that it does not set the height of the iFrame to match the height of the content. I think that iFrame Resizer can be used to fix it. This requires the script iframeResizer.contentWindow.min.js to be included in the page contained within the iFrame. This can be done by the plugin, but only when the GET parameter
?embedded=trueis passed to the url.
Another problem is that it displays extra content, which are useful in a full page display but are useless in an embedded display. This can be fixed by adding extra CSS code, which are included by the plugin only when the GET parameter
?embedded=trueis defined, and which hides the parts of the page that are irrelevant for the embedded case. As an example see the difference between https://btranslator.org/vocabulary/ICT_sq and https://btranslator.org/vocabulary/ICT_sq?display=iframe . The second case is more suitable to be displayed inside an iFrame.
I could have tried to build this plugin myself, but I am not familiar with RoR and with the Discourse details, so I need some help. From what I have seen around (in other discussions) at least the first 2 steps should not be very difficult. But maybe the last step is not too difficult either.