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

**URL:** https://meta.discourse.org/t/embedding-discourse-in-static-sites-does-not-work-discourse-posts-are-not-generated-for-blog-entries/31869
**Category:** Support
**Created:** [2015 年8 月 7 日 12:53 UTC](https://meta.discourse.org/t/embedding-discourse-in-static-sites-does-not-work-discourse-posts-are-not-generated-for-blog-entries/31869 "2015-08-07T12:53:29Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![Flow](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/flow/32/105280_2.png) [@Flow](https://meta.discourse.org/u/Flow)
#### Post date: [2015 年8 月 7 日 12:53 UTC](https://meta.discourse.org/t/embedding-discourse-in-static-sites-does-not-work-discourse-posts-are-not-generated-for-blog-entries/31869/1 "2015-08-07T12:53:29Z")

</div>

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 [http://eviltrout.com/2014/01/22/embedding-discourse.html](http://eviltrout.com/2014/01/22/embedding-discourse.html).

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?

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [2015 年8 月 7 日 15:23 UTC](https://meta.discourse.org/t/embedding-discourse-in-static-sites-does-not-work-discourse-posts-are-not-generated-for-blog-entries/31869/2 "2015-08-07T15:23:29Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Flow](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/flow/32/105280_2.png) [@Flow](https://meta.discourse.org/u/Flow)
#### Post date: [2015 年8 月 7 日 15:32 UTC](https://meta.discourse.org/t/embedding-discourse-in-static-sites-does-not-work-discourse-posts-are-not-generated-for-blog-entries/31869/3 "2015-08-07T15:32:41Z")

</div>

Thanks @eviltrout. So far I got

> Refused to display ‘[http://forums.xy.eu/embed/comments?embed\_url=http%3A%2F%xy.eu%2Fflow%2Fposts%2F2014-09-24-post.html](http://forums.xy.eu/embed/comments?embed_url=http%3A%2F%25xy.eu%2Fflow%2Fposts%2F2014-09-24-post.html)’ in a frame because it set ‘X-Frame-Options’ to ‘SAMEORIGIN’.

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [2015 年8 月 7 日 15:40 UTC](https://meta.discourse.org/t/embedding-discourse-in-static-sites-does-not-work-discourse-posts-are-not-generated-for-blog-entries/31869/4 "2015-08-07T15:40:23Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Flow](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/flow/32/105280_2.png) [@Flow](https://meta.discourse.org/u/Flow)
#### Post date: [2015 年8 月 7 日 16:13 UTC](https://meta.discourse.org/t/embedding-discourse-in-static-sites-does-not-work-discourse-posts-are-not-generated-for-blog-entries/31869/5 "2015-08-07T16:13:17Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [2015 年8 月 7 日 18:26 UTC](https://meta.discourse.org/t/embedding-discourse-in-static-sites-does-not-work-discourse-posts-are-not-generated-for-blog-entries/31869/6 "2015-08-07T18:26:11Z")

</div>

Yes, that would do it.

---

<div class="post-metadata">

### Author: ![Flow](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/flow/32/105280_2.png) [@Flow](https://meta.discourse.org/u/Flow)
#### Post date: [2015 年8 月 10 日 10:21 UTC](https://meta.discourse.org/t/embedding-discourse-in-static-sites-does-not-work-discourse-posts-are-not-generated-for-blog-entries/31869/7 "2015-08-10T10:21:04Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [2015 年8 月 10 日 10:40 UTC](https://meta.discourse.org/t/embedding-discourse-in-static-sites-does-not-work-discourse-posts-are-not-generated-for-blog-entries/31869/8 "2015-08-10T10:40:05Z")

</div>

We should have better protection here @eviltrout if possible.

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [2015 年8 月 10 日 19:28 UTC](https://meta.discourse.org/t/embedding-discourse-in-static-sites-does-not-work-discourse-posts-are-not-generated-for-blog-entries/31869/9 "2015-08-10T19:28:58Z")

</div>

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](https://github.com/discourse/discourse/commit/b02d624503e0bf24840fabfa9b8433250204478f)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [2015 年8 月 10 日 21:07 UTC](https://meta.discourse.org/t/embedding-discourse-in-static-sites-does-not-work-discourse-posts-are-not-generated-for-blog-entries/31869/10 "2015-08-10T21:07:15Z")

</div>


