mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-23 10:53:34 +03:00
🎨 change location of adapters (#8286)
closes #7687 - change location from content/storage or content/scheduling to content/adapters/storage or content/adapters/scheduling - i have added a @TODO to https://github.com/TryGhost/Ghost/issues/7421 to check if both adapter types needs an update in the documentation
This commit is contained in:
parent
59a8911830
commit
be5b58432b
2
.gitignore
vendored
2
.gitignore
vendored
@ -50,6 +50,8 @@ Session.vim
|
|||||||
/content/apps/**/*
|
/content/apps/**/*
|
||||||
/content/themes/**/*
|
/content/themes/**/*
|
||||||
/content/images/**/*
|
/content/images/**/*
|
||||||
|
/content/adapters/storage/**/*
|
||||||
|
/content/adapters/scheduling/**/*
|
||||||
!/content/themes/casper/**
|
!/content/themes/casper/**
|
||||||
!/README.md
|
!/README.md
|
||||||
|
|
||||||
|
23
content/adapters/README.md
Normal file
23
content/adapters/README.md
Normal file
@ -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
|
||||||
|
|
@ -49,16 +49,16 @@ exports.makePathsAbsolute = function makePathsAbsolute(obj, parent) {
|
|||||||
*/
|
*/
|
||||||
exports.getContentPath = function getContentPath(type) {
|
exports.getContentPath = function getContentPath(type) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'storage':
|
|
||||||
return path.join(this.get('paths:contentPath'), 'storage/');
|
|
||||||
case 'images':
|
case 'images':
|
||||||
return path.join(this.get('paths:contentPath'), 'images/');
|
return path.join(this.get('paths:contentPath'), 'images/');
|
||||||
case 'apps':
|
case 'apps':
|
||||||
return path.join(this.get('paths:contentPath'), 'apps/');
|
return path.join(this.get('paths:contentPath'), 'apps/');
|
||||||
case 'themes':
|
case 'themes':
|
||||||
return path.join(this.get('paths:contentPath'), 'themes/');
|
return path.join(this.get('paths:contentPath'), 'themes/');
|
||||||
|
case 'storage':
|
||||||
|
return path.join(this.get('paths:contentPath'), 'adapters', 'storage/');
|
||||||
case 'scheduling':
|
case 'scheduling':
|
||||||
return path.join(this.get('paths:contentPath'), 'scheduling/');
|
return path.join(this.get('paths:contentPath'), 'adapters', 'scheduling/');
|
||||||
case 'logs':
|
case 'logs':
|
||||||
return path.join(this.get('paths:contentPath'), 'logs/');
|
return path.join(this.get('paths:contentPath'), 'logs/');
|
||||||
case 'data':
|
case 'data':
|
||||||
|
Loading…
Reference in New Issue
Block a user