Been trying to figure this out for two days and must be thinking about it incorrectly. I'd like to support the following workflow:<p>- write in markdown with YAML frontmatter (or similar)<p>- query files and frontmatter from different apps & sites through an API (ideally GraphQL)<p>It seems this word is divided into two segments:<p>1. Git-based CMS like Forestry, Grav, Netlify which allows you to source from git flat files, modify and deploy in their ecosystem as a static site<p>2. Headless CMS's like Contentful, Strapi, etc that expose an API layer atop their CMS database (or in the case of Hasura, atop Postgres, MySQL, etc)<p>There are many examples of sourcing content from a headless CMS to a static site or git-based CMS, but not vice-versa. For example, you can have a Gatsby + Contentful site deployed on Netlify, but in this case, you're sourcing front Contentful to Gatsby (which can also source from flat files / git), but you can't then fetch them from a third party app.<p>I already maintain my content in git as markdown, and my aim is to fetch that content (paginate, filter by frontmatter, etc) in a Nuxt app, in Webflow, on a blog (e.g., static site). I could potentially fetch the various repository's files through Git's API, but then I'd have a ton of client-side logic in each app or place I'd like to use that content.<p>Effectively I'm looking for how to set up a thin API layer over flat files (hosted on Git or otherwise). Like a Hasura with markdown as the source. Like a Headless CMS that can source and/or sync with flat files. (Or to set this up myself.)
Have you tried using Gatsby's GraphQL API as a standalone server? The dev server in Gatsby lets you use the GraphQL endpoint running at `___graphiql`. I wrote about this in <a href="https://hasura.io/blog/data-federation-in-graphql-using-hasura-remote-joins-and-gatsby/" rel="nofollow">https://hasura.io/blog/data-federation-in-graphql-using-hasu...</a>
Would this require a schema of sorts for the markdown files so the API could inspect or parse the files in a structured way? Something akin to a template?