Discourse integration as a link

Hello Community,

I am working on integrating the Discourse commenting embed with functionalities similar to BoinBoing,
where the integration acts as a link and takes users to the related topic on discourse.

Here is the screenshot of boing boing’s implementation.

To my understanding, this feature is possible using discourse’s wordpress plugin.
I was wondering if it would be possible to implement this feature for ghost.

Thank you.

cc @vikaspotluri123

  • What’s your URL? This is the easiest way for others to debug your issue
  • What version of Ghost are you using?
  • What configuration?
  • What browser?
  • What errors or information do you see in the console?
  • What steps could someone else take to reproduce the issue you’re having?

I wrote a wrapper a couple years ago that fetches the comment count for a set of nodes:

You could wrap this with a link to the discourse instance + slug
(eg talk.my.blog/t/{slug}). Discourse does a pretty good job of finding the proper topic

3 Likes

I did some searching and stumbled upon this very GitHub repo, if there was fire reactions I’d be clicking it right now :fire:

2 Likes

Yes, I saw that repo that is why I CC’d you as a domain expert :slight_smile:.
Adding a link is straight forward, but I would like to have the functionality to create the topic if it does not exist.

Aah, I think that should be covered in the integration guide:

As far as I’m aware, by setting up the integration in discourse, topics will be created when needed

2 Likes

That is a great integration guide.

The main problem with that configuration of the embed is that the embed script runs as soon as a post is visited, it scrapes the post and create a topic accordingly.

That causes a flood of unwanted topics in discourse without any comments.

So optimally I am looking for a link like implementation where only a topic is created when the “comment” link is clicked for the first time.

Oh, interesting…

I guess a workaround would be to only load the embed script if there are any comments, or if the url has a specific query / hash param - e.g. https://my.blog/awesome-post/?comments=true

As an aside, I am not an expert with the Discourse API. There might be a method to do what you’re trying to do with their API.