alienlebarge / handle
A Kirby plugin that automatically transforms social handles into links to their profiles
Installs: 10
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:kirby-plugin
Requires
- php: >=7.4
- getkirby/composer-installer: ^1.1
Requires (Dev)
- phpunit/phpunit: ^9.5
README
This plugin automatically transforms social handles (like @user@instance
) into links to their corresponding profiles.
Installation
Download
Download and place this plugin in /site/plugins/handle
.
Composer
composer require alienlebarge/handle
Usage
Field Method
<?= $page->text()->kirbytext()->handleLinks() ?>
Automatic
The plugin automatically processes all texts passed through kirbytext.
KirbyTag
(handle: @user@instance)
or
(handle: user: username instance: bsky.app)
Configuration
You can configure the services in your config.php
file:
return [ 'handle.services' => [ 'bsky.app' => [ 'urlPrefix' => 'https://bsky.app/profile/', 'urlSuffix' => '', 'class' => 'bsky-link' ], // Other services... ] ];
Default Supported Services
- Fediverse (Mastodon, etc.)
- Bluesky (bsky.app)
- Flickr
- GitHub
- Micro.blog
- YouTube
- Vimeo
License
MIT
Usage
In your templates
You can use the plugin in several ways:
-
Automatically (via the kirbytags:after hook):
<?= $page->text()->kirbytext() ?>
-
Manually (via the field method):
<?= $page->text()->kirbytext()->handleLinks() ?>
-
Via KirbyTag:
(handle: @heydon@social.lol)
or
(handle: user: heydon instance: social.lol)