satnaing / astro-paper

A minimal, accessible and SEO-friendly Astro blog theme
https://astro-paper.pages.dev/
MIT License
2.13k stars 440 forks source link

astro-paper can also be headless CMS #105

Open xiyuvi opened 11 months ago

xiyuvi commented 11 months ago

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

mattppal commented 11 months ago

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...

satnaing commented 9 months ago

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

mattppal commented 9 months ago

@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.

xiyuvi commented 9 months ago

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