/pages-store

GitHub Pages Storage Adapter for Ghost

Primary LanguageJavaScriptMIT LicenseMIT

pages-store

NPM Downloads NPM Version License Dependency Status devDependency Status Code Style

GitHub Pages Storage Adapter for Ghost

Installation

Via Yarn or NPM

  • Install pages-store module

    yarn add pages-store
    # or npm
    npm install pages-store
  • Make the storage folder if it doesn't exist yet

    mkdir -p content/adapters/storage
  • Copy the module into the right location

    cp -vR node_modules/pages-store content/adapters/storage/pages-store

Via Git

In order to replace the storage module, the basic requirements are:

  • Create a new folder inside content/adapters called storage

  • Clone this repo to storage

    cd [path/to/ghost]/content/adapters/storage
    git clone https://github.com/zce/pages-store.git
  • Install dependencies

    cd pages-store
    yarn
    # or
    npm install

Usage

In your config.[env].json file, you'll need to add a new storage block to whichever environment you want to change:

{
  "storage": {
    "active": "pages-store",
    "pages-store": {
      "prefix": "http://zce.github.io/storage",
      "repo": "zce/storage"
    }
  }
}

Options

{
  "storage": {
    "active": "pages-store",
    "pages-store": {
      "repo": "https://git.coding.net/zce/images.git",
      "branch": "master",
      "prefix": "https://img.zce.me",
      "format": "{yyyy}/{mm}/{dd}/{name}-{uuid}-{timestamp}-{random}{ext}"
    }
  }
}

Authorization

You can use URL authentication:

  • GitHub: https://<TOKEN>@github.com/zce/images.git
  • GitLab/Coding: https://<USERNAME>:<TOKEN>@git.coding.net/zce/images.git

depends on the service.

Contributing

  1. Fork it on GitHub!
  2. Clone the fork to your own machine.
  3. Checkout your feature branch: git checkout -b my-awesome-feature
  4. Commit your changes to your own branch: git commit -am 'Add some feature'
  5. Push your work back up to your fork: git push -u origin my-awesome-feature
  6. Submit a Pull Request so that we can review your changes.

NOTE: Be sure to merge the latest from "upstream" before making a pull request!

Related

License

MIT © 汪磊