Skip to content

Add "Like" feature to blog posts via discourse integration #8034

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
biru-codeastromer opened this issue Apr 10, 2025 · 8 comments
Open

Add "Like" feature to blog posts via discourse integration #8034

biru-codeastromer opened this issue Apr 10, 2025 · 8 comments

Comments

@biru-codeastromer
Copy link
Contributor

biru-codeastromer commented Apr 10, 2025

Suggestion

This proposed idea suggests adding a "like" functionality for Jenkins blog posts , using Discourse integration rather than implementing a dynamic feature directly in the static site.

During a discussion in gitter , I made an idea of having "like" feature in the blogs . I got positive response from Kris on this idea..

Zbynek gave an exciting and important insights on this by citing "probably can't be part of the blog (because blog should remain static without a server side), but maybe there could be better integration with Discourse where each blog post has an entry in https://community.jenkins.io/c/blog/23 ...and people can leave comments/likes in Discourse."

Let's see what our maintainers have their thoughts (more of it) on this !

Links

No response

Are you interested in contributing to this improvement?

Yes but there will be need of a healthy discussion on this before moving ahead with anything..

@krisstern
Copy link
Member

I think people can already like entries in our Discourse at community.jenkins.io. But we do have a the About the Blog & News category there we can utilise. Not so sure if it is worth investigating how we may cross post blog posts there, and fetch the user stats like the like count from there.

The Discourse API docs can be found at https://docs.discourse.org/ for a reference.

@biru-codeastromer
Copy link
Contributor Author

biru-codeastromer commented Apr 10, 2025

Thanks for this input, yes we do can like in our discourse also other emojis..

Thanks for the reference..that docs can help us a lot , I will now look into the discourse api docs and how we can integrate it maybe...

I will give a prototype of what my logic will be in here ; and get yours and other maintainers feedbacks on the approach and discuss further better approaches if we need...

@biru-codeastromer
Copy link
Contributor Author

biru-codeastromer commented Apr 17, 2025

The integration would work by linking each blog post to a corresponding Discourse thread through a simple discourse_topic_id in the post's front matter...We will display like counts by fetching them client-side from Discourse's API (using /t/{id}.json) and showing them next to each post, both on listing pages and individual posts. This implementation will require no backend changes, as it uses static front matter to store thread IDs and lightweight JS to fetch counts. Users would see a 'Like' link/button that takes them to Discourse to engage, while the displayed count updates dynamically. If JS fails, it gracefully degrades to just show the link... We can optimise performance by caching API responses and loading counts after page rendering.

What your thoughts on this ?

@AadiSharma49
Copy link

Hello, I’d love to contribute to this idea. It's like a great way to engage the community more. I’ll explore the Discourse API and try building a simple prototype to show the like counts. Let me know if anyone’s already working on this, or if there are any preferences for how the UI should look!
@biru-codeastromer are you working on it ?

@biru-codeastromer
Copy link
Contributor Author

Hi @AadiSharma49, thanks for the ping!

Yes, this is indeed on our radar, but it requires some further discussion before we can finalize any specific approach. We're currently in talks with the maintainers to figure out the best way forward.

@AadiSharma49
Copy link

ok @biru-codeastromer !

@krisstern
Copy link
Member

Hi @AadiSharma49 as mentioned previously (or above),

I think people can already like entries in our Discourse at community.jenkins.io. But we do have a the About the Blog & News category there we can utilise. Not so sure if it is worth investigating how we may cross post blog posts there, and fetch the user stats like the like count from there.

I don't think we currrently have a mechanism in place on Discourse to cross-post our new blog posts from jenkins.io to community.jenkins.io, which means that there is no way you can meaningfully implement this feature at this point.

@AadiSharma49
Copy link

yeah okay @krisstern

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants