定制 teamnovu/statamic-unused-assets 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

teamnovu/statamic-unused-assets

最新稳定版本:v2.0.2

Composer 安装命令:

composer require teamnovu/statamic-unused-assets

包简介

Addon to list all assets not in use on your Statamic dashboard.

README 文档

README

This is an addon to list all assets that are not used in your statamic site.

Features

This addon adds a widget which you can add to your dashboard. If there are assets which are currently not in use on your sites they will be listed in that widget.

How to Install

Run the following command in your project root:

composer require teamnovu/statamic-unused-assets

How to Use

Just add the widget to your config/statamic/cp.php as you would any other widget.

The following is an example which shows all the possible config values you can use.

'widgets' => [
    // ...

        [
            'type' => 'unused-assets', // Required
            'limit' => 300, // Default: 300 – The number of images to display from the widget.
            'width' => 100, // Default: 100 – The size of the widget.
            'excluded_paths' => [], // Example: ['assets/myFolder/'] - Default: [] – The paths to exclude from the search.
        ],
],

Note This widget caches the assets displayed forever and updates the cache when events such as AssetDeleted, AssetSaved AssetUploaded EntryDeleted, EntrySaved TermDeleted, TermSaved GlobalSetDeleted, GlobalSetSaved are fired.

Development

This addon workers due to the potential heavy workload. To test the addon localy a queue worker needs to be running e.g.

php artisan queue:listen

Credit

This widget has basically been extracted from the Statamic Peak starter kit updated with inspiration from Swiftmade Statamic Clear Assets

统计信息

  • 总下载量: 15.99k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 3
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-12-01