schnti / autoresize
此包已被放弃,不再维护。没有建议替代包。
Kirby Autoresize 插件
0.1.2
2019-03-24 21:40 UTC
Requires
This package is auto-updated.
Last update: 2023-08-25 08:17:42 UTC
README
这是一个为 Kirby 3 CMS 制作的插件,用于在上传图片时缩小图片并替换为最大尺寸。
商业用途
此插件是免费的,但如果您在商业项目中使用它,请考虑
安装
下载
下载文件 并将它们放入 site/plugins/autoresize
中。
Git 子模块
您可以将插件作为 Git 子模块添加。
$ cd your/project/root
$ git submodule add https://github.com/schnti/kirby3-autoresize.git site/plugins/autoresize
$ git submodule update --init --recursive
$ git commit -am "Add Kirby Autoresize plugin"
运行以下命令以更新插件
$ cd your/project/root
$ git submodule foreach git checkout master
$ git submodule foreach git pull
$ git commit -am "Update submodules"
$ git submodule update --init --recursive
Composer
composer require schnti/autoresize
选项
您可以在 /site/config/config.php
中更改默认的 1500px 宽度
return [ 'schnti.autoresize.max' => 1500, 'schnti.autoresize.customConfig', [ 'imagekit.lazy' => false // e.g. for use with https://github.com/fabianmichael/kirby-imagekit ] ];
如何使用它
无需额外要求。插件使用 Kirby 的 file.create:after
和 file.replace:after
钩子