elephpant.me
elephpant.me copied to clipboard
Generate appropriate mastodon profile URL from handle
trafficstars
Description
This PR introduces a helper function for generating Mastodon profile URL directly from user handle within Laravel Blade templates. By providing a Mastodon handle, the helper dynamically constructs the corresponding profile URL, allowing other mastodon instance than mastodon.social.
Changes
- Added a new helper function for generating Mastodon profile URL from handle
- Integrated the helper function into
resources/views/herd/show.blade.phpBlade template - Included a unit test to validate various handle formats
Usage
To use this feature in a Blade template, simply pass a valid Mastodon handle to the helper function:
<a href="{{ Mastodon::profileUrl('@username@instance') }}">Profile</a>
Hey @jgrossi 👋
Do you think this PR is relevant?