How to write Ghost posts in Markdown and track via git?

Hi!

First off, I wanted to thank the team for creating Ghost - I love that it’s open source, user funded, and helping support the next generation of content creators. Awesome!

Currently I have a Jekyll blog hosted on GitHub pages, but I’m interested in switching to Ghost for the Members features.

I would prefer to write my posts locally in Markdown, track their history using git (via a repo on GitHub, and then publish them to hosted Ghost when ready.

Is this workflow possible? I’ve done a bit of searching and it does not appear to be trivial currently.

If I was able to simply write posts in Markdown, offline, in my IDE, and store those posts in git, I would get the following for free with no work on Ghost’s part:

  • Multi-author writing
  • Infinite, fine-grained history
  • Use an existing writing flow I’m comfortable with
  • Write offline

In short: being able to use a static site generator writing flow in Ghost would be great for me, and I imagine many others coming from that background. If there’s an easy way to do it, please let me know! :pray:

1 Like

You can publish to ghost from iA Writer or Ulysses on Mac. Post2Ghost or another API/command line client will let you use your existing IDE.

GitHub offers web hooks that you can use to trigger Post2Ghost to run on a push, commit, or tag. If you’re using GitLab, you can modify the GitLab CI YAML to use a command to run something like Spooky to publish your post.

If you push regularly to your git repo, it’ll probably be worth updating the script to enumerate the posts and match the title (or slug), and then do an update instead of create/publish.

It’s possible to do, but how easy you can do it varies depending on the IDE/Markdown Editor, or if you want a pure Git workflow.

The forum won’t let me share links to everything, so if you need more clarification, feel free to ask.

Hey @kmwallio! Thanks so much for the detailed info and quick response, I really appreciate it!

Hm good point, GitHub Action + Post2Ghost could work. I’ll give it a try and when I get the chance.

Friendly ask to the Ghost team Powers That Be, if they’re reading this, that supporting static site generator-esque writing flows would be :100:

So that they’re all tracked in the same place, see also @andrewklajman’s post here: Bulk import markdown text as posts in Ghost.