feat: AWS S3 + Digitalocean Spaces storage modules (#1015)
* Provide basic implementation of AWS S3 storage module * Abstract S3 Compatible Storage Module logic * Refactor `getFileExtension()` into the `page` object * Add implementation for Digitalocean storage module * Remove accidental `async`/`await` in S3 Storage Module * Remove argument from the call to `page.getFileExtension()` https://github.com/Requarks/wiki/pull/1015#discussion_r321990073
This commit is contained in:
committed by
Nicolas Giard
parent
3ab7bcf8ea
commit
5202eadebb
@@ -147,6 +147,20 @@ module.exports = class Page extends Model {
|
||||
return pageHelper.injectPageMetadata(this)
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the page's file extension based on content type
|
||||
*/
|
||||
getFileExtension() {
|
||||
switch (this.contentType) {
|
||||
case 'markdown':
|
||||
return 'md'
|
||||
case 'html':
|
||||
return 'html'
|
||||
default:
|
||||
return 'txt'
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse injected page metadata from raw content
|
||||
*
|
||||
|
Reference in New Issue
Block a user