Skip to content
Returns Ghost content as markdown files for static site generators like Jekyll to consume.
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.


Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore Create .gitignore Oct 16, 2019
LICENSE Remove straggling `config` Mar 18, 2020
index.js Amend plugin name Feb 26, 2020
package.json Update package.json Feb 26, 2020

Netlify Ghost Markdown Build Plugin

This plugin generates posts and pages from a Ghost publication as markdown files, using the Ghost Content API. In addition it will copy images from the Ghost publication into a local assets directory. Pages, posts and images will be generated on the onPreBuild event in the Netlify deployment cycle, this is to ensure the files are present before an actual build occurs.


Before you can use this package you'll need a Netlify project that can consume markdown files and images. This package was built with Jekyll in mind, however in theory it should work with any static site generator . Additionally you'll need the Netlify CLI tool installed and Build Plugins Beta enabled.


To install, add the following lines to your netlify.toml file:

package = "netlify-plugin-ghost-markdown"

   ghostURL = "https://YOURGHOST.URL"
   ghostKey = "YOURGHOSTKEY"

Note: The [[plugins]] line is required for each plugin, even if you have other plugins in your netlify.toml file already.

You'll need to get a Ghost Content API URL and key to authenticate with your Ghost publication. Please see the Ghost documentation for more info.

Psst, test credentials can be "borrowed" from here:


package = "netlify-plugin-ghost-markdown"

  ghostURL = "https://YOURGHOST.URL"
  ghostKey = "YOURGHOSTKEY"

  # Optionally set a directory for images
  assetsDir = "./assets/images/"

  # Optionally set a directory for pages
  pagesDir = "./"

  # Optionally set a directory for posts
  postsDir = "./_posts/"

  # Optionally remove the date prefix from post filenames
  postDatePrefix = true

Currently posts follow the Jekyll markdown file name format. Set the postDatePrefix to false to use the post slug as the file name


  1. Create a testing project using a static site generator like Jekyll:

    gem install bundler jekyll
    jekyll new my-awesome-site
  2. Move into that project, cd my-awesome-site

  3. Clone this repo into a _plugins directory using the following:

    git clone _netlify-plugin-ghost-markdown
  4. Move into the plugin directory, cd _plugins

  5. Run npm install

  6. Create a new netlify.toml file with the following:

    package = "_netlify-plugin-ghost-markdown"
      ghostURL = "https://YOURGHOST.URL"
      ghostKey = "YOURGHOSTKEY"
      # Remember to get your Ghost API credentials
  7. Run netlify build


Released under the MIT license.

You can’t perform that action at this time.