定制 tobiaswolf/transform-urls 二次开发

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

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

tobiaswolf/transform-urls

Composer 安装命令:

composer require tobiaswolf/transform-urls

包简介

Transforms uuid links in writer fields to links with readable path.

README 文档

README

Transforms uuid links in writer fields to links with readable path.

Before:

Lorem <a href="/@/page/vnEifKM2ECWtLyyq">Ispum</a>
Dolor <a href="/@/file/AADooEhhPozGHzfl">sit</a>

After:

Lorem <a href="https://example.com/lorem/ipsum>Ispum</a>
Dolor <a href="https://example.com/media/pages/dolor-sit/d948bff236-1694729834/example.jpg">sit</a>

Installation

Download

Download and copy this repository to /site/plugins/transform-urls.

Git submodule

git submodule add https://github.com/tobiasfabian/kirby-transform-urls.git site/plugins/transform-urls

Composer

composer require tobiaswolf/transform-urls

Usage

This plugin provides a Field method called transformUrls(). You can use it on any field – most likely you want to use it for writer fields. The method searches for uuid links (e.g. /@/page/vnEifKM2ECWtLyyq) and transforms them to an URL with the full path (e.g. https://example.com/lorem/ipsum).

<?= $block->text()->transformUrls() ?>

If the page/file is not found by the UUID, the link will not be changed. If the debug mode is activated it will throw an error.

License

MIT

Credits

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-09-22