Convert ghost posts to markdown files ready to use with Jekyll.
Turns this
<h1>Blog Title</h1><p>Blog content.</p>
Into a file called 2023-01-15-blog-title.md
containing this
---
title: Blog Title
---
# Blog Title
Blog content.
From the root directory of the repo, build the docker image.
docker build -t ghost-to-jekyll .
Install ruby v3.1.3
manually or using a ruby version manager like rbenv.
Install dependencies.
bundle install
Export your Ghost content using a web browser or the CLI. More info available here.
Then run ruby bin/ghost_to_jekyll -f <path-to-backup-file>.json
or for Docker
docker run -v <volume-name>:/root/ghost-to-jekyll/converted_posts ghost-to-jekyll -f <path-to-backup-file>.json
When running locally without Docker, files are saved to your home directory $HOME/ghost-to-jekyll/converted_posts
.
When running with Docker the converted files will be saved to the volume which you specify. To learn more about how volumes work in Docker go here.