Is there a nice GH badges (ala shields.io images) design to put in README to link from GitHub to our hosted discourse?

As the title says.

I am looking for something like these:

…but for discourse. Is there one?

2 Likes

Let’s see if @erlend_sh has ideas here?

1 Like

shields.io allows you to create custom badges; e.g.

https://img.shields.io/badge/discourse-forum-brightgreen.svg?style=flat-square

3 Likes

Feel free to investigate how to get Discourse added to the official shields.io listing:

https://github.com/badges/shields/blob/master/CONTRIBUTING.md

No need for any API interaction; it should be static.

1 Like

Thanks! Will see what I what I can help w adding an official badge.

Meanwhile I think this will work nicely:

![](//assets-meta-cdck-prod-meta.s3.dualstack.us-west-1.amazonaws.com/original/3X/9/7/97a29a66b7cc810e0d97e431718513a0da062ed0.svg)
1 Like

Without API interaction, there is no need for having it appear on shields.io.

Here’s the markdown code that should work:

[![Discourse](https://img.shields.io/badge/discourse-online-green.svg)](https://meta.discourse.com)

The rendered results look like this:

The verbiage can be changed in the svg URL (e.g. discourse-online-green.svg could be discourse-forum-blue.svg)

2 Likes

Before this though we need to get travis into a much happier state, it is still way too flaky. Some tests need love. I did see a random segfault yesterday on travis not sure how we would recover from that and keep the build green.

3 Likes

Is there an API endpoint that will tell us the current state of the app? I ask because it seems that Travis only represents latest master right? I wonder if this badge needs to indicate latest master status or the status of their own instance.

What does this have to do with the status of travis? The OP just wanted some flair to put in the readme of their project (a “click here to join our forum” type button). I fail to see why that would have to include the build status of discourse/discourse.

Related to the travis flakiness. Have y’all considered CircleCI? It is not 100% without fault but it is considerably more stable than travis.

1 Like

https://meta.discourse.org/srv/status will give you 200 when the app is up and operational.

https://meta.discourse.org/site/statistics.json will give you basic information that can be useful in a badge, like, number of posts in the last 7/30 days (which is kinda of equivalent to online users in a async communication platform like Discourse)

6 Likes

This is ideal. With the https://discuss.emberjs.com/srv/status page (visible for all installs), having it exist on shields.io would make sense.

I’ll go ahead with this and create a PR

4 Likes

I submitted a PR to badges/shields

https://github.com/badges/shields/pull/1326

11 Likes

Nice, I think the “users” one carries the most weight if you have good number of users!

4 Likes

@sam Do you know if there are many discourse hosts in the wild that are not using https? My PR to shields assumes they all are. This is likely a poor assumption.

If the HTTP request library that shields.io use handles redirects, you can set it to http and it will work for http and https.

If not, defaulting to https only should be good enough. We do everything in the discourse-setup script to make it as easy as possible.

3 Likes

Perfect. Thanks @Falco!

1 Like

Wow, you guys rock! Thanks @coderberry !

1 Like

Would anyone know why it shows as invalid for us?

Discussion Forum
https://img.shields.io/discourse/https/discuss.grakn.ai/topics

Meanwhile, you can see that https://discuss.grakn.ai is live. :thinking:

1 Like