Skip to content

Commit

Permalink
🎨 change location of adapters (#8286)
Browse files Browse the repository at this point in the history
closes #7687

- change location from content/storage or content/scheduling to content/adapters/storage or content/adapters/scheduling
- i have added a @todo to #7421 to check if both adapter types needs an update in the documentation
  • Loading branch information
kirrg001 authored and ErisDS committed Apr 7, 2017
1 parent 59a8911 commit be5b584
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ Session.vim
/content/apps/**/*
/content/themes/**/*
/content/images/**/*
/content/adapters/storage/**/*
/content/adapters/scheduling/**/*
!/content/themes/casper/**
!/README.md

Expand Down
23 changes: 23 additions & 0 deletions content/adapters/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Content / Adapters


An adapter is a way to override a default behaviour in Ghost.
The default behaviour in Ghost is as following:

### LocalFileStorage
By default Ghost will upload your images to the `content/images` folder.
The LocalFileStorage is using the file system to read or write images.
This default adapter can be found in `core/server/storage/LocalFileStorage.js`.

### SchedulingDefault
By default Ghost will schedule your posts using a pure JavaScript solution.
It doesn't use `cron` or similar.
This default adapter can be found in `core/server/scheduling/SchedulingDefault.js`.

### Custom Adapter
To override any of the default adapters, you have to add a folder (`content/adapters/storage` or `content/adapters/scheduling`) and copy your adapter to it.

Please follow our detailed guides:
https://github.com/TryGhost/Ghost/wiki/Using-a-custom-storage-module
https://github.com/TryGhost/Ghost/wiki/Using-a-custom-scheduling-module

6 changes: 3 additions & 3 deletions core/server/config/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,16 @@ exports.makePathsAbsolute = function makePathsAbsolute(obj, parent) {
*/
exports.getContentPath = function getContentPath(type) {
switch (type) {
case 'storage':
return path.join(this.get('paths:contentPath'), 'storage/');
case 'images':
return path.join(this.get('paths:contentPath'), 'images/');
case 'apps':
return path.join(this.get('paths:contentPath'), 'apps/');
case 'themes':
return path.join(this.get('paths:contentPath'), 'themes/');
case 'storage':
return path.join(this.get('paths:contentPath'), 'adapters', 'storage/');
case 'scheduling':
return path.join(this.get('paths:contentPath'), 'scheduling/');
return path.join(this.get('paths:contentPath'), 'adapters', 'scheduling/');
case 'logs':
return path.join(this.get('paths:contentPath'), 'logs/');
case 'data':
Expand Down

0 comments on commit be5b584

Please sign in to comment.