【发布时间】:2019-01-23 20:36:36
【问题描述】:
我试图弄清楚如何强制 Cloudinary 在 Keystone 中使用 HTTPS。
尝试在实际的 post.hbs 页面中使用 {{cloudinaryUrl image width=500 height=500 crop='fill'secure='true'}},但没有成功。
我看到有人提到过这个,但不知道这个人指的是哪个文件。
【问题讨论】:
标签: https cloudinary keystonejs
我试图弄清楚如何强制 Cloudinary 在 Keystone 中使用 HTTPS。
尝试在实际的 post.hbs 页面中使用 {{cloudinaryUrl image width=500 height=500 crop='fill'secure='true'}},但没有成功。
我看到有人提到过这个,但不知道这个人指的是哪个文件。
【问题讨论】:
标签: https cloudinary keystonejs
如果您在 http 中提供您的页面,但您想强制 cloudinary 为 https,您可以在 keystone.init 函数中设置选项:'cloudinary secure': true,
此选项映射到here 描述的云选项上
keystone.init({
'name': 'xyz',
...
'cloudinary secure': true,
....
当你像这样打印一个 src 图像时,打开这个选项会改变 http 到 https 协议:
src=post._.image.src({dpr:'auto'}) // pug syntax
【讨论】: