0.1.33 • Published 2 years ago

@tryghost/mg-substack-csv v0.1.33

Weekly downloads
7
License
MIT
Repository
github
Last release
2 years ago

Migrate Substack Posts CSV Export

⛔️ This package has been superseded by mg-substack, and is no longer maintained.


Converts the Substack Posts CSV (plus optional posts directory) and generates a zip file you can import into a Ghost installation.

Install

To install the CLI, which is required for the Usage commands below:

npm install --global @tryghost/migrate

To use this package in your own project:

npm install @tryghost/mg-substack-csv --save

or

yarn add @tryghost/mg-substack-csv

Usage

To run an absolute basic Substack migration, the required command is this:

migrate substack <path to csv file>

It's possible to pass more options, in order to achieve a better migration file for Ghost:

  • -V --verbose
    • Show verbose output
    • bool - default: false
  • --zip
    • Create a zip file
    • bool - default: true
  • -s --scrape
    • Configure scraping tasks
    • string - default: all
    • Choices: all, img, web, media, none
  • --size_limit
    • number - default: false
    • Media files larger than this size (defined in MB i.e. 5) will be flagged as oversize
  • -e --email
    • Provide an email domain for users e.g. person@example.com (Is ignored if --useMetaAuthor is provided)
    • bool/string - default: false
  • -u --url
    • Provide a URL (without trailing slash) to the hosted source site, so we can scrape data e.g. https://example.substack.com
    • string - default:https://ghost.io
  • -p --readPosts
    • Provide a path to a posts folder that contains HTML files (file name = post id) to read the post content
    • string - default: null
  • --drafts
    • Import draft posts
    • bool - default: true
  • --threads
    • Import thread posts
    • bool - default: false
  • --subscribeLink
    • Provide a path that existing /subscribe anchors will link to e.g. /join-us or #/portal/signup (# characters need to be escaped with a \)
    • string - default: null
  • --commentLink
    • Provide a path that existing /comments anchors will link to e.g. #ghost-comments-root (# characters need to be escaped with a \)
    • string - default: null
  • --useMetaImage
    • Use og:image value as the feature image
    • bool - default: false
  • --useMetaAuthor
    • Use the author field from ld+json (useful for posts with multiple authors)
    • bool - default: false
  • --postsBefore
    • Only migrate posts before and including a given date e.g. 'March 20 2018'
    • string - default: null
  • --postsAfter
    • Only migrate posts after and including a given date e.g. 'August 16 2022'
    • string - default: null
  • --fallBackHTMLCard
    • Fall back to convert to HTMLCard, if standard Mobiledoc convert fails
    • bool - default: false

Note: You can combine --postsBefore and --postsAfter to migrate posts between 2 dates.

A more realistic command for a Substack migration looks like this:

migrate substack <path to post.csv file> --url <URL to substack instance> --readPosts <path to directory containing html files> --subscribeLink \#/portal/signup --useMetaImage true --useMetaAuthor true

Develop

This is a mono repository, managed with lerna.

Follow the instructions for the top-level repo. 1. git clone this repo & cd into it as usual 2. Run yarn to install top-level dependencies.

Run

To run a local development copy, cd into this directory, and use yarn dev instead of migrate like so:

yarn dev substack <path to csv file>

Test

  • yarn lint run just eslint
  • yarn test run lint and tests

Copyright & License

Copyright (c) 2013-2022 Ghost Foundation - Released under the MIT license.

0.1.32

2 years ago

0.1.33

2 years ago

0.1.31

2 years ago

0.1.30

2 years ago

0.1.27

2 years ago

0.1.28

2 years ago

0.1.25

2 years ago

0.1.24

3 years ago

0.1.23

3 years ago

0.1.22

3 years ago

0.1.21

3 years ago

0.1.20

3 years ago

0.1.19

3 years ago

0.1.18

3 years ago

0.1.17

3 years ago

0.1.16

3 years ago

0.1.15

3 years ago

0.1.14

3 years ago

0.1.13

3 years ago

0.1.12

4 years ago

0.1.11

4 years ago

0.1.10

4 years ago

0.1.9

4 years ago

0.1.8

4 years ago

0.1.7

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago