PHP code example of alienlebarge / handle

1. Go to this page and download the library: Download alienlebarge/handle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

alienlebarge / handle example snippets


<?= $page->text()->kirbytext()->handleLinks() 

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...
  ]
];

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

'alienlebarge.handle.services' => [
  'github.com' => [
    'enabled' => true,           // New > true,   // New optional field
    'name' => 'GitHub'          // New optional field
  ]
]

   <?= $page->text()->kirbytext() 

   <?= $page->text()->handleLinks() 

'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'
  ]
]