A utility for downloading content and images from a site running Ghost. Currently designed for the Ghost API version 3. Feel free to download the source code and tweak it to fit your needs.
- Node.js version 12.x or higher.
- Clone or download this repository.
- Install dependencies using
npm
npm install
- Create a
.env
file or copy the.env.sample
to.env
.GHOST_API_URL=https://reverentgeek.com GHOST_CONTENT_API_KEY= SITE_URL=https://reverentgeek.com
- Change the
GHOST_API_URL
andSITE_URL
values to match your Ghost site and your destination site. - Login to your Ghost admin panel.
- Under Settings, click Integrations.
- Click Add custom integration.
- Enter name, such as Eleventy Export and click Create.
- Copy the Content API Key and update the
GHOST_CONTENT_API_KEY
value in the.env
file.
Run the utility from the command line using Node.js. Available command-line options:
Usage: node . [options]
Options:
-o, --out <folder> directory to write exported content
(defaults to 'site' in the current folder)
--ghost-url <apiUrl> Ghost site url
--ghost-api-key <apiKey> Ghost API key
--site-url <siteUrl> Destination site url, if different than Ghost site url
--skip-images skip downloading images
--skip-pages skip exporting pages
--skip-posts skip exporting posts
--slugs [slugs] comma-separated list of content slug to convert explicitly
from html to markdown
--filter [slugs] comma-separated list of content slugs to skip conversion
--debug Write unprocessed original content to out folder as JSON
-h, --help display help for command
If you run the utility without any command line arguments...
node .
...you should expect a new folder named site
with all the content and images downloaded.