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:
Andrew Sim
2019-09-09 02:11:25 +01:00
committed by Nicolas Giard
parent 3ab7bcf8ea
commit 5202eadebb
8 changed files with 132 additions and 101 deletions

View File

@@ -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
*