代码拉取完成,页面将自动刷新
This Ghost custom storage module allows you to store media file with TencentCloud COS instead of storing at local machine.
Install COS storage module
npm install ghost-cos-store
Make the storage folder if it doesn't exist yet
mkdir -p content/adapters/storage
Create a script named "ghost-cos-store.js", content as follow:
// content/adapters/storage/ghost-cos-store.js
module.exports = require('ghost-cos-store');
In order to replace the storage module, the basic requirements are:
storage
inside content/adapters
/storage
mkdir -p [ghost/path]/content/adapters/storage
cd [ghost/path]/content/adapters/storage
git clone https://github.com/tencentyun/ghost-cos-store.git
cd ghost-cos-store
npm i
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-cos-store",
"ghost-cos-store": {
"BasePath": "资源路径,如 ghost/ ,不填写默认为根目录",
"SecretId": "SecretId,在腾讯云控制台获取",
"SecretKey": "SecretKey,在腾讯云控制台获取",
"Bucket": "<BucketName>-<AppId>,如 test-1250000000",
"Region": "<Region>,如 ap-chengdu",
"QueryString": "可带上万象处理参数,如?imageMogr2/format/<format>"
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。