承接 rasteiner/k3-image-tag 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

rasteiner/k3-image-tag

Composer 安装命令:

composer require rasteiner/k3-image-tag

包简介

An (image: ...) tag that resizes the image.

README 文档

README

For Kirby v.3.

This plugin replaces the default (image: ...) tag with a version that resizes the image to a maximum size specified in your config.php. It also allows you to redefine the generated HTML code via a snippet.

Installation

Download

Download and copy this repository to /site/plugins/k3-image-tag.

Git submodule

git submodule add https://github.com/rasteiner/k3-image-tag.git site/plugins/k3-image-tag

Composer

composer require rasteiner/k3-image-tag

Setup

Example for simply resizing the image:

site/config/config.php:

return [
  'imagetag' => [
    'max-width': 1400
  ]
];

Example snippet for a custom snippet:

site/config/config.php:

return [
  'imagetag' => [
    'snippet': 'imagetag'
  ]
];

site/snippets/imagetag.php:

<a href="<?= $image->resize(2000)->url() ?>" data-fancybox="page"><img src="<?= $image->resize(900)->url() ?>" alt="<?= html($alt) ?? $image->alt()->html() ?>" /></a>

Notice that the output of the snippet will still be parsed as markdown (beacuse the output of all kirbytags is). Line breaks in your HTML might be interpreted as "paragraps" for markdown, which might have unintended outcomes in the DOM.

The following $variables are passed to the snippet:

  • $image: the resolved File object to the original image passed to the tag
  • All attributes specified in the tag are extracted to variables.

License

MIT

Credits

Plugin based on the getkirby/pluginkit template, made by lukasbestle.

统计信息

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

GitHub 信息

  • Stars: 2
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-02-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固