Skip to content

Commit

Permalink
Add ShareProviders add Tumblr share provider
Browse files Browse the repository at this point in the history
  • Loading branch information
kudashevs committed Jan 14, 2025
1 parent 698496c commit 0b493c5
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ a flexible and convenient way within seconds. The package was originated from th
* Bluesky
* Mastodon
* Hacker News
* Tumblr
* Telegram
* WhatsApp
* VKontakte
Expand Down Expand Up @@ -139,6 +140,7 @@ twitter($options) # Generates an X (former Twitter) share button
bluesky($options) # Generates a Bluesky share button
mastodon($options) # Generates a Mastodon share button
hackernews($options) # Generates a Hacker News share button
tumblr($options) # Generates a Tumblr share button
telegram($options) # Generates a Telegram share button
whatsapp($options) # Generates a WhatsApp share button
vkontakte($options) # Generates a VKontakte 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 @@ -94,6 +94,10 @@
'url' => 'https://telegram.me/share/url?url=:url&text=:text',
'text' => 'Default share text',
],
'tumblr' => [
'url' => 'https://www.tumblr.com/share?v=3&u=:url&t=:text',
'text' => 'Default share text',
],
'twitter' => [
'url' => 'https://twitter.com/intent/tweet?text=:text&url=:url',
'text' => 'Default share text',
Expand Down Expand Up @@ -136,6 +140,7 @@
'reddit' => '<a href=":url" class="social-button:class":id:title:rel><span class="fab fa-reddit"></span></a>',
'skype' => '<a href=":url" class="social-button:class":id:title:rel><span class="fab fa-skype"></span></a>',
'telegram' => '<a href=":url" class="social-button:class":id:title:rel target="_blank"><span class="fab fa-telegram"></span></a>',
'tumblr' => '<a href=":url" class="social-button:class":id:title:rel target="_blank"><span class="fab fa-square-tumblr"></span></a>',
'twitter' => '<a href=":url" class="social-button:class":id:title:rel><span class="fab fa-square-x-twitter"></span></a>',
'vkontakte' => '<a href=":url" class="social-button:class":id:title:rel><span class="fab fa-vk"></span></a>',
'whatsapp' => '<a href=":url" class="social-button:class":id:title:rel target="_blank"><span class="fab fa-square-whatsapp"></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 @@ -23,6 +23,7 @@
* @method ShareButtons reddit(array $options = [])
* @method ShareButtons skype(array $options = [])
* @method ShareButtons telegram(array $options = [])
* @method ShareButtons tumblr(array $options = [])
* @method ShareButtons twitter(array $options = [])
* @method ShareButtons vkontakte(array $options = [])
* @method ShareButtons whatsapp(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 @@ -26,6 +26,7 @@
* @method ShareButtons reddit(array $options = [])
* @method ShareButtons skype(array $options = [])
* @method ShareButtons telegram(array $options = [])
* @method ShareButtons tumblr(array $options = [])
* @method ShareButtons twitter(array $options = [])
* @method ShareButtons vkontakte(array $options = [])
* @method ShareButtons whatsapp(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 @@ -181,6 +181,12 @@ public static function provideDifferentShareButtonsValues(): array
'My telegram title',
'https://telegram.me/share/url?url=https%3A%2F%2Fmysite.com&text=My+telegram+title',
],
'tumblr' => [
'tumblr',
'https://mysite.com',
'My tumblr title',
'https://www.tumblr.com/share?v=3&u=https%3A%2F%2Fmysite.com&t=My+tumblr+title',
],
'twitter' => [
'twitter',
'https://mysite.com',
Expand Down

0 comments on commit 0b493c5

Please sign in to comment.