Embedding Discourse in static sites does not work: Discourse Posts are not generated for blog entries


(Florian Schmaus) #1

I’ve switched to a docker based discourse installation and can’t get the embedding to work. It has worked fine with the old installation following Embedding Discourse in Static Sites - Evil Trout’s Blog.

I did not change anything on the blog, where the discourse posts should be embedded for comments. I set

  • embeddable hosts
  • feed polling enabled
  • feed polling url
  • embed by username
  • embed category

But discourse just doesn’t create the posts for the blog entries. The feed URL is correct. The logs and error logs are empty.

How can I diagnose the issue? Is there a way to forcefully re-trigger the blog post creation or something like that?


(Robin Ward) #2

Did you check the javascript logs in the developer console of the site embedding your discourse site? If there’s nothing there, try checking the network tab and seeing if a request is being made to your server.


(Florian Schmaus) #3

Thanks @eviltrout. So far I got

Refused to display ‘Quick & easy European Patent (EP) validation service -’ in a frame because it set ‘X-Frame-Options’ to ‘SAMEORIGIN’.


(Robin Ward) #4

Can you double check that your embeddable_host matches the server you are embedding it in?


(Florian Schmaus) #5

After removing and adding a few hosts to embeddable hosts it suddenly worked. I’m nearly 100% positive that I had entered the correct host domain. The only difference I spot now is that it is now without a trailing slash ‘/’. E.g. instead of

myblog.org/

I have now

myblog.org

not sure if this could have been the culprit.


(Kane York) #6

Yes, that would do it.


(Florian Schmaus) #7

Ahh, ok. Then I’d like to state the feature request to ‘normalize’ entered URLs for embeddable_host, e.g. remove http(s):// and a eventually existing trailing slash.


(Jeff Atwood) #8

We should have better protection here @eviltrout if possible.


(Robin Ward) #9

Okay, I’ve made it really robust now. It will support URLs with http/s and even trailing paths:

https://github.com/discourse/discourse/commit/b02d624503e0bf24840fabfa9b8433250204478f


(Jeff Atwood) #10