elephpant.me icon indicating copy to clipboard operation
elephpant.me copied to clipboard

Generate appropriate mastodon profile URL from handle

Open arnissolle opened this issue 1 year ago • 1 comments
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.php Blade 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>

arnissolle avatar Oct 26 '24 13:10 arnissolle

Hey @jgrossi 👋

Do you think this PR is relevant?

arnissolle avatar Jan 19 '25 21:01 arnissolle