[SOLVED]Can't get discourse embedded properly into Ghost


(Ars Artificia) #1

Hi all,
I followed @eviltrout 's awesome tutorial here Embedding Discourse in Static Sites - Evil Trout’s Blog but can’t get it to work properly.

This is how it looks embedded :

<div id="discourse-comments"></div>
<script type="text/javascript">
var discourseUrl = "http://discourse.ars-artificia.com/",
discourseEmbedUrl = 'http://ars-artificia.com/Spring cleaning';
(function() {
var d = document.createElement('script'); d.type = 'text/javascript'; d.async = true;
d.src = discourseUrl + 'javascripts/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(d);})();
</script>

see https://ars-artificia.com/spring-cleaning/ for reference.
My discourse is set up accordingly. I am using ghost to host my blog - I don’t get any changes.
Thanks in advance !

For reference here is how @codinghorror embedded discourse in his blog

</article>
<div id="discourse-comments"></div>
<script type="text/javascript">
      var discourseUrl = "http://discourse.codinghorror.com/",
          discourseEmbedUrl = 'http://blog.codinghorror.com/the-god-login/';

      (function() {
        var d = document.createElement('script'); d.type = 'text/javascript'; d.async = true;
          d.src = discourseUrl + 'javascripts/embed.js';
        (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(d);
      })();
    </script>
</main>

and this is my current version:

</footer>
    </article>
	<div id="discourse-comments"></div>
	<script type="text/javascript">
		var discourseUrl = "http://discourse.ars-artificia.com/",
		discourseEmbedUrl = 'https://ars-artificia.com/spring-cleaning/';
		(function() {
			var d = document.createElement('script'); d.type = 'text/javascript'; d.async = true;
			d.src = discourseUrl + 'javascripts/embed.js';
			(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(d);
		})();
	</script>

Edit: Found the solution !!
As my discourse instance isn’t ssl secured yet, I embedded non-secure content on a secure website. This was blocked in my browser (firefox) because of security issues ! In e.g. interntet explorer everything works fine :smile: thanks a lot for the help, @bartv and @Mittineague !
ISSUE SOLVED

Edit: Grabbed some new ssl certs and verified everything is working properly now. Remember that you can’t simply embed non secure content into a https site !


(Mittineague) #2

Change the forum so it doesn’t require being logged it to access it.


(Ars Artificia) #3

Thanks for the suggestion. Porting the posts worked anyway - I changed it but the comments still do not appear. Might be an issue with the ghost templating


(Mittineague) #4

“Spring cleaning” is not the same as “spring-cleaning”

Make sure discourseEmbedUrl is the canonical URL to the page where you are embedding Discourse.


(Ars Artificia) #5

ah damn. Thanks for pointing that out !


(Ars Artificia) #6

fixed it, but it’s still not working :confused:


(Bart) #7

Are you seeing any errors in the discourse server log? I battled this for a while too.


(Ars Artificia) #8

the log I can see on my discourse webui doesn’t show anything. is there a log on the filesystem I need to check as well ?


(Bart) #9

If you’re using a docker installation, I believe you should be able to find those in

/var/discourse/shared/standalone/log/var-log

(Ars Artificia) #10

The syslog states nothing unusual and there aren’t any error logs present =/
I’m kinda out of ideas right now, so I’d gladly take any advice …
Edit: Found the solution !!
As my discourse instance isn’t ssl secured yet, I embedded non-secure content on a secure website. This was blocked in my browser (firefox) because of security issues ! In e.g. interntet explorer everything works fine :smile: thanks a lot for the help, @bartv and @Mittineague !
ISSUE SOLVED


(Robin Ward) #11