ghost-github-storage
v1.0.0
Published
GitHub Storage Adapter for Ghost Blog
Downloads
11
Maintainers
Readme
pages-store
GitHub Pages Storage Adapter for Ghost
Installation
Via Yarn or NPM
Install pages-store module
yarn add ghost-github-storage # or npm npm install ghost-github-storage
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/ghost-github-storage content/adapters/storage/ghost-github-storage
Via Git
In order to replace the storage module, the basic requirements are:
Create a new folder inside
content/adapters
calledstorage
Clone this repo to
storage
cd [path/to/ghost]/content/adapters/storage git clone https://github.com/wangkezun/ghost-github-storage.git
Install dependencies
cd ghost-github-storage 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": "ghost-github-storage",
"ghost-github-storage": {
"token": "YOUR_GITHUB_TOKEN",
"repo": "REPO_NAME",
"owner": "YOUR_GITHUB_USER_NAME"
}
}
}
Adapter will check the repo existence and create a new repo if not exist and check branch existence and checkout a new branch if not exist
Use gh-pages as branch name and leave prefix blank is recommended for github will automatic publish image to github.io
change configs will not affect images that already uploaded.
Options
{
"storage": {
"active": "ghost-github-storage",
"ghost-github-storage": {
"branch": "gh-pages", // using default is recommended
"prefix": "https://wangkezun.github.io/ghost-assets", // by default adapter will generate this prefix
"format": "{yyyy}/{mm}/{dd}/{name}-{uuid}-{timestamp}-{random}{ext}"
}
}
}
Contributing
- Fork it on GitHub!
- Clone the fork to your own machine.
- Checkout your feature branch:
git checkout -b my-awesome-feature
- Commit your changes to your own branch:
git commit -am 'Add some feature'
- Push your work back up to your fork:
git push -u origin my-awesome-feature
- 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!