astro-paper icon indicating copy to clipboard operation
astro-paper copied to clipboard

astro-paper can also be headless CMS

Open xiyuvi opened this issue 1 year ago • 4 comments

I want to create a static JSON data from the article list and Markdown document, which can be used by other external programs。 I hope astro can support this feature, so that astro can play the role of headless CMS. Thank you very much

xiyuvi avatar Aug 08 '23 10:08 xiyuvi

This would actually be quite helpful for me as well— I assume you're trying to import into something like Ghost? I spent a little while playing around with it, but it seems quite complex.

We'd need a way to export the markdown files to mobiledoc in that case...

mattppal avatar Aug 08 '23 17:08 mattppal

Sounds interesting. I've never used (and imagined to do) something like this. I mean I'm unfamiliar with this kind of stuff. Thus, can you please explain a bit more? Like

  • the need to export JSON data extracted from blog contents?
  • how about the contents inside the config file?
  • etc

satnaing avatar Sep 15 '23 05:09 satnaing

@satnaing I spent sometime playing with Ghost (here's a useful repo and the astro docs)

The issue comes with supplying the Ghost API with content— it seems particularly difficult to accomplish with how AstroPaper is structured.

I also came across TS Ghost, which might be interesting.

mattppal avatar Sep 15 '23 20:09 mattppal

Sounds interesting. I've never used (and imagined to do) something like this. I mean I'm unfamiliar with this kind of stuff. Thus, can you please explain a bit more? Like

  • the need to export JSON data extracted from blog contents?
  • how about the contents inside the config file?
  • etc

Like this, perhaps you have heard of Hexo, which is a static blog generator. Hexo has a plugin called "Hexo generator restful", which can generate JSON format APIs from MD documents for third-party calls.

https://github.com/yscoder/hexo-generator-restful

https://xiyu.pro/api/posts.json

xiyuvi avatar Oct 08 '23 04:10 xiyuvi