I am trying to set up Discourse as a headless API server. I need to show the full text of the topic and the images in my custom-built landing page. I am able to get the full text with always_include_topic_excerpts setting. However, the excerpt doesn’t have images.
Hi Kris, thanks for responding. I need the full topic text when I hit /latest.json. By default, it only returns the topic title with the exception of some posts (announcements?) where it also returns an excerpt. With the always_include_topic_excerts setting on, I am able to get the full text except links and images. I am looking for a way to get links and images in the excerpt.
Thanks for the draft PR @chandan.gupta but we strip images from excerpts for a reason
and we also don’t like to add extra site settings unless there’s a lot of demand for them. If you really need this on your site, then I suggest creating a plugin for it.
@sam would it be a complex plugin to return the posts[0].raw or posts[0].cooked along with /latest.json? This way, we wouldn’t need to piggyback on “excerpt”, and it would also satisfy our needs. Could you point me to any reference to implement this? I understand that this would involve a lot more database reads, but I am ok with this performance cost.