Embedding Discourse in Static Sites


I’m using Harp.io to run a blog – it’s default generator for RSS generates a blank <item> without a title or description. Also, it looks like the import bypasses title validation and I have a post with no title which is hard to drill down to :slight_smile:

Have hacked in a fix for the feed, but a few thoughts spring to mind.

  • discourse import should not create posts from <item> with blank titles
  • when is the RSS feed polled by Discourse? I’m assuming its when the embed is called from the blog
  • how do you initiate another import/update; ie. when you have corrected a blog post how do you force an update
  • how is discourse determining the uniqueness of the blog post its importing? is this a hash of the URL? ie if I change the title but leave the URL the same will it simply update the original post

PS. should I be posting this sort of query on http://meta.discourse.org? i can’t find a place that seems suitable.


For some reason the RSS import is leaving the tail end of the CDATA wrapper in the post, converted to entities.


An example item from the feed:

<title>Posterous FarCry Blog Archive</title>
<![CDATA[<p>With the move to GitHub repos, we&#39;ve moved the <a href="/com.posterous.farcry/">FarCry Committers Blog</a> to GitHub Pages.</p> <p>Going through older posts, its great to stumble across some gems in there. If you have a favourite let us know and we&#39;ll update and re-post in the new format.</p> <p>Onwards!</p> ]]>
<pubDate>March 27, 2013</pubDate>
<guid isPermaLink="true">

Here’s what it looks like on my forum:

Or alternatively a link (as i don’t appear to have a high enough trust level):

I note this does not happen on Eviltrout as you are using ATOM.


Actually I would post this on meta as a bug category, since it’s more specific to Discourse than it is my blog :smile:


Will Discourse import images that are in an RSS feed? I am returning a media:group with a media:content and media:thumbnail, but It’s not adding them to the created topic. Just not sure if it is something I am doing wrong, or something that isn’t implemented yet.


No it will not right now, sorry!


“If your site does not have an XML feed, Discourse will create topics based on your page contents using a readability algorithm. It’s remarkably accurate for those cases when your site doesn’t have a feed.”

Can someone point out where this algorithm lives? Thank you.


Great, thanks. I have been using Vanilla forums for the same matter, but it started to fill up with too much spam so I had to turn Disqus on again. I will test this feature for some days.


I will try Discourse too for my projects…


Is it possible to embed the whole discurse on a static web site without using an iframe?


Thanks again @eviltrout for this great code snippet which I have been using with great success on my drupal site as I documented on meta - maybe my recipe with minor changes to your snippet will be of interest to others.


This week a Kabissa volunteer pointed out that onebox embedding in the comments is not showing up correctly on the blog. I reported this bug on meta and @techAPJ fixed it for the wp-discourse plugin.

It still needs to be fixed on my site and presumably also on many others that use this snippet of yours - please let me know if you have since updated your snippet or can fix this easily for all of us.

Simple test: Let’s see if the youtube video below shows up both on your blog and in your discourse:


I can see the video.


Really? I only see the video in discourse, not in blog comments. I have screenshots but am not allowed to upload them. Arrgh.

Just tried chrome, chrome incognito, and firefox. Still same deal.


Hey, on your blog, there’s a counter that tells how many comments/replies are in the Discourse thread. I’ve embedded Discourse on my website, but how do I get that metric to appear on my blog’s main page?


And I was putting the host without “www”.

It’s kinda sad it doesn’t work that way, means if I have any other masked domain pointing to the same place, only the first one will work. :frowning:


What’s the best way to troubleshoot embedding? I created a new discourse site, http://forum.railsonmaui.com that should pull from http://www.railsonmaui.com, using the atom feed: http://www.railsonmaui.com/atom.xml.

Everything seems setup, but nothing happens. Is there some delay for sidekiq to start processing the feed? Any other tips on seeing if the configuration is correct? Or has errors?

OK – So the answer is just wait an hour!


Absolutely rocks for getting a new forum populated!!!

The main problem I have now is that the formatting of the code samples comes out totally funky: http://forum.railsonmaui.com/t/migrating-from-bash-to-zsh/50

Any solution to that issue?

I found a workaround:

/* fix code samples for imports from blog */
figure.code td.gutter {
    display: none;

.cooked figure.code .highlight {
    background-color: #f8f8f8;


I wrote up detailed instructions for setting up Discourse.org comments for an Octopress blog:



Hello …
for the moment I don’t manage to embed my discourse in my static site with NO rss…
how would you do that ?


RSS is needed to sync the content across.


After trying the embed-feature, I have to say that I was disappointed, and we will probably not use discourse because of this. Just to be fair, I want to be specific on what I think you need to change:

  1. When a user would want to comment an article on my site, he clicks on the “Continue discussion” which leads to a different site in a different browser tab. That’s not acceptable to me. And further more, after posting the comment, the user has no easy path to get back to my site.

  2. Relying on RSS to create the forum topics is not going to work for me, since I will potentially have millions of topics that need to be created. Instead, I want to do an API-call explicitly to create the corresponding forum topics necessary.

  3. I think the lack of documentation on the discourse site is remarkable. Just the fact that I had to find this embed feature on a post on semi-related blog.

Other than this, I think discourse looks promising, but not ready for the things I need.
Best luck in developing discourse to its full potential!