scottboms/kirbytag-svg
Composer 安装命令:
composer require scottboms/kirbytag-svg
包简介
Kirbytag SVG Plugin
README 文档
README
A kirbytag for outputting SVG images inline with a number of customizable attributes.
Requirements
Installation
Kirby CLI
kirby plugin:install scottboms/kirbytag-svg
Git Submodule
$ git submodule add https://github.com/scottboms/kirbytag-svg.git site/plugins/kirbytag-svg
Copy and Paste
- Download the contents of this repository as a Zip file.
- Rename the extracted folder to
kirbytag-svgand copy it into thesite/plugins/directory in your Kirby project.
Usage
(svg: yourfile.svg)
Optionally, you can specify a custom wrapper element to wrap the SVG along with class and role attributes that will be applied to that element. If class or role attributes are included but no wrapper element, a 'figure' element will be used.
The tag now supports all of these value types while preserving the existing path-based behavior:
- page-local filenames, like
icon.svg - Kirby file IDs/paths, like
projects/example/icon.svg - Kirby file UUIDs, like
file://abc123... - existing root-relative or filesystem-style SVG paths, like
/assets/icons/icon.svg
Optional Tag Attributes
wrapper: A wrapper element to surround the SVG when output in your template [optional]class: A CSS class/classes to append to the wrapper element [optional]role: A role attribute appended to the wrapper element [optional]
Example usage:
(svg: /img/deke.svg)
(svg: lerxst.svg wrapper: figure class: svg role: img)
(svg: /assets/icons/pratt.svg wrapper: div class: icon)
(svg: projects/example/logo.svg)
(svg: file://your-file-uuid)
Configuration Options
You can add a default wrapper element to SVGs using the provided config option that can be added to your config.php file as shown.
<?php return [ 'scottboms.kirbytag-svg.wrapper' => 'div', ]
Compatibility
- Kirby 3.5+
- Kirby 4.x
- Kirby 5.x
Disclaimer
This plugin is provided "as is" with no guarantee. Use it at your own risk and always test it yourself before using it in a production environment. If you find any issues, please create a new issue.
License
You are prohibited from using this plugin in any project that promotes racism, sexism, homophobia, animal abuse, violence or any other form of hate speech.
scottboms/kirbytag-svg 适用场景与选型建议
scottboms/kirbytag-svg 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 10 次下载、GitHub Stars 达 5, 最近一次更新时间为 2024 年 03 月 05 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 scottboms/kirbytag-svg 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 scottboms/kirbytag-svg 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 10
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 7
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-03-05
