PHPackages                             alienlebarge/handle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. alienlebarge/handle

ActiveKirby-plugin[Utility &amp; Helpers](/categories/utility)

alienlebarge/handle
===================

A Kirby plugin that automatically transforms social handles into links to their profiles

0.0.5(1y ago)125MITPHPPHP &gt;=7.4

Since Apr 24Pushed 1y ago1 watchersCompare

[ Source](https://github.com/alienlebarge/handle)[ Packagist](https://packagist.org/packages/alienlebarge/handle)[ RSS](/packages/alienlebarge-handle/feed)WikiDiscussions main Synced today

READMEChangelog (5)Dependencies (2)Versions (12)Used By (0)

Handle Plugin for Kirby CMS
===========================

[](#handle-plugin-for-kirby-cms)

A Kirby plugin that automatically transforms social handles (like `@user@instance`) into clickable links to their profiles. Supports Unicode characters, custom services, and comprehensive configuration options.

Installation
------------

[](#installation)

### Download

[](#download)

Download and place this plugin in `/site/plugins/handle`.

### Composer

[](#composer)

```
composer require alienlebarge/handle

```

### Git

[](#git)

```
git submodule add https://github.com/alienlebarge/handle.git site/plugins/handle

```

Usage
-----

[](#usage)

### Field Method

[](#field-method)

```

```

### Automatic

[](#automatic)

The plugin automatically processes all texts passed through kirbytext.

### KirbyTag

[](#kirbytag)

```
(handle: @user@instance)

```

or

```
(handle: user: username instance: bsky.app)

```

Configuration
-------------

[](#configuration)

Configure the plugin in your `config.php` file:

```
return [
  // Global plugin settings
  'alienlebarge.handle.enabled' => true,
  'alienlebarge.handle.maxTextLength' => 100000,
  'alienlebarge.handle.logErrors' => true,
  'alienlebarge.handle.enableFediverse' => true,

  // Service configurations
  'alienlebarge.handle.services' => [
    'bsky.app' => [
      'enabled' => true,
      'urlPrefix' => 'https://bsky.app/profile/',
      'urlSuffix' => '',
      'class' => 'bsky-link',
      'displayUsername' => true,
      'name' => 'Bluesky'
    ],
    // Add custom services...
  ]
];
```

See [CONFIG.md](CONFIG.md) for detailed configuration options and examples.

Default Supported Services
--------------------------

[](#default-supported-services)

- Fediverse (Mastodon, etc.)
- Bluesky (bsky.app)
- Flickr
- GitHub
- Instagram
- LinkedIn
- Micro.blog
- Reddit
- YouTube
- Vimeo

Migration from v0.0.3
---------------------

[](#migration-from-v003)

If upgrading from v0.0.3, update your configuration:

**Before:**

```
'handle.services' => [
  'github.com' => [
    'urlPrefix' => 'https://github.com/',
    'class' => 'github-link'
  ]
]
```

**After:**

```
'alienlebarge.handle.services' => [
  'github.com' => [
    'enabled' => true,           // New required field
    'urlPrefix' => 'https://github.com/',
    'class' => 'github-link',
    'displayUsername' => true,   // New optional field
    'name' => 'GitHub'          // New optional field
  ]
]
```

License
-------

[](#license)

MIT

Features
--------

[](#features)

- **Automatic Processing**: Transforms handles via `kirbytext:before` hook
- **Unicode Support**: Works with international usernames and domains
- **Security**: XSS protection with input validation and sanitization
- **Performance**: Optimized with early returns and configurable text size limits
- **Extensible**: Easy to add custom services and configure behavior
- **Code Protection**: Preserves handles in code blocks and backticks

Requirements
------------

[](#requirements)

- PHP &gt;= 7.4
- Kirby CMS &gt;= 3.0

Advanced Usage
--------------

[](#advanced-usage)

### In your templates

[](#in-your-templates)

The plugin works in several ways:

1. **Automatically** (via the `kirbytext:before` hook):

    ```

    ```
2. **Manually** (via the field method):

    ```

    ```
3. **Via KirbyTag**:

    ```
    (handle: @heydon@social.lol)

    ```

    or

    ```
    (handle: user: heydon instance: social.lol)

    ```

### Adding Custom Services

[](#adding-custom-services)

```
'alienlebarge.handle.services' => [
  'mastodon.social' => [
    'enabled' => true,
    'urlPrefix' => 'https://mastodon.social/@',
    'urlSuffix' => '',
    'class' => 'mastodon-link',
    'displayUsername' => true,
    'name' => 'Mastodon Social'
  ],
  'custom-platform.com' => [
    'enabled' => true,
    'urlPrefix' => 'https://custom-platform.com/users/',
    'urlSuffix' => '/profile',
    'class' => 'custom-platform-link',
    'displayUsername' => false, // Show @username@instance
    'name' => 'Custom Platform'
  ]
]
```

**Service Configuration Options:**

- **`enabled`** (bool): Enable/disable this service
- **`urlPrefix`** (string, required): Base URL for user profiles
- **`urlSuffix`** (string): Optional suffix added to URLs
- **`class`** (string, required): CSS class for styling links
- **`displayUsername`** (bool): Show only `@username` (true) or `@username@instance` (false)
- **`name`** (string): Human-readable service name for documentation

**Validation Rules:**

- URL Format: Must be valid HTTP/HTTPS URLs
- CSS Classes: Must follow CSS naming conventions (`[a-zA-Z][a-zA-Z0-9\-_]*`)
- Required Fields: `urlPrefix` and `class` are mandatory

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance49

Moderate activity, may be stable

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~6 days

Recently: every ~0 days

Total

11

Last Release

375d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/611234?v=4)[Cédric Aellen](/maintainers/alienlebarge)[@alienlebarge](https://github.com/alienlebarge)

---

Top Contributors

[![alienlebarge](https://avatars.githubusercontent.com/u/611234?v=4)](https://github.com/alienlebarge "alienlebarge (26 commits)")

---

Tags

kirbykirby-cmskirby-plugin

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/alienlebarge-handle/health.svg)

```
[![Health](https://phpackages.com/badges/alienlebarge-handle/health.svg)](https://phpackages.com/packages/alienlebarge-handle)
```

###  Alternatives

[getkirby/cms

The Kirby core

1.5k584.8k473](/packages/getkirby-cms)[medienbaecker/kirby-modules

Easily add modules to your pages

895.5k1](/packages/medienbaecker-kirby-modules)[distantnative/retour-for-kirby

Manage redirects and track 404s right from the Kirby CMS Panel

14698.5k1](/packages/distantnative-retour-for-kirby)[arnoson/kirby-vite

Vite helper for Kirby CMS

9765.1k3](/packages/arnoson-kirby-vite)[bnomei/kirby3-dotenv

Kirby Plugin for environment variables from .env

4149.6k2](/packages/bnomei-kirby3-dotenv)[medienbaecker/kirby-alter

242.1k](/packages/medienbaecker-kirby-alter)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
