Skip to content

Commit

Permalink
Add ShareProviders add Bluesky share provider
Browse files Browse the repository at this point in the history
  • Loading branch information
kudashevs committed Dec 7, 2024
1 parent 195bf5b commit 388b29d
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ a flexible and convenient way within seconds. The package was originated from th

* Facebook
* X (formerly Twitter)
* Bluesky
* LinkedIn
* Telegram
* WhatsApp
Expand Down Expand Up @@ -127,7 +128,8 @@ Each method accepts an array of options (more information about these options in
[//]: # (@todo don't forget to update these methods)
```
facebook($options) # Generates a Facebook share button
twitter($options) # Generates a Twitter share button
twitter($options) # Generates an X (former Twitter) share button
bluesky($options) # Generates a Bluesky share button
linkedin($options) # Generates a LinkedIn share button
telegram($options) # Generates a Telegram share button
whatsapp($options) # Generates a WhatsApp share button
Expand Down
5 changes: 5 additions & 0 deletions config/share-buttons.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
*/

'buttons' => [
'bluesky' => [
'url' => 'https://bsky.app/intent/compose?text=:url%20:text',
'text' => 'Default share text',
],
'copylink' => [
'url' => ':url',
'extra' => [
Expand Down Expand Up @@ -115,6 +119,7 @@
*/

'templates' => [
'bluesky' => '<a href=":url" class="social-button:class":id:title:rel><span class="fab fa-square-bluesky"></span></a>',
'copylink' => '<a href=":url" class="social-button:class" id="clip":title:rel><span class="fas fa-share"></span></a>',
'evernote' => '<a href=":url" class="social-button:class":id:title:rel><span class="fab fa-evernote"></span></a>',
'facebook' => '<a href=":url" class="social-button:class":id:title:rel><span class="fab fa-facebook-square"></span></a>',
Expand Down
1 change: 1 addition & 0 deletions src/Facades/ShareButtonsFacade.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
*
* @method ShareButtons page($url, string $title = '', array $options = [])
* @method ShareButtons currentPage($url, string $title = '', array $options = [])
* @method ShareButtons bluesky(array $options = [])
* @method ShareButtons copylink(array $options = [])
* @method ShareButtons evernote(array $options = [])
* @method ShareButtons facebook(array $options = [])
Expand Down
1 change: 1 addition & 0 deletions src/ShareButtons.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
/**
* @todo don't forget to update these method signatures
*
* @method ShareButtons bluesky(array $options = [])
* @method ShareButtons copylink(array $options = [])
* @method ShareButtons evernote(array $options = [])
* @method ShareButtons facebook(array $options = [])
Expand Down
6 changes: 6 additions & 0 deletions tests/Acceptance/ShareButtonsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ public function it_can_generate_an_expected_share_button(
public static function provideDifferentShareButtonsValues(): array
{
return [
'bluesky' => [
'bluesky',
'https://mysite.com',
'My bluesky title',
'https://bsky.app/intent/compose?text=https%3A%2F%2Fmysite.com%20My+bluesky+title',
],
'copylink' => [
'copylink',
'https://mysite.com',
Expand Down

0 comments on commit 388b29d

Please sign in to comment.