Upload images from Github .md file using Discourse API

Hi all,

I use a Node.js workflow to connect Github repository and Discourse through Discourse API.
Every time someone pushes .md file in a repository automatically Discourse topic is created using POST request https://{defaultHost}/posts.json or if the topic already exits - I just update it with PUT request https://{defaultHost}/posts/{id}.json.

I have a problem with the images - there is couple of ways to include image in Github .md file. The following are working fine and the images are uploaded to Discourse:

but the following two are not working:

Is there a way to ensure that all the images from the .md file will be uploaded to Discourse?

1 Like

If your script is pushing the raw md from github to discourse then you’ll need to have your script find those relative links and add the github domain.

2 Likes