Skip to content

Latest commit

 

History

History
58 lines (46 loc) · 2.07 KB

README.md

File metadata and controls

58 lines (46 loc) · 2.07 KB

Ghost Exporter for Eleventy

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.

Requirements

Configuration

  1. Clone or download this repository.
  2. Install dependencies using npm
    npm install
  3. 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
  4. Change the GHOST_API_URL and SITE_URL values to match your Ghost site and your destination site.
  5. Login to your Ghost admin panel.
  6. Under Settings, click Integrations.
  7. Click Add custom integration.
  8. Enter name, such as Eleventy Export and click Create.
  9. Copy the Content API Key and update the GHOST_CONTENT_API_KEY value in the .env file.

Usage

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.