Skip to content

Commit

Permalink
Added Mastodon share code
Browse files Browse the repository at this point in the history
  • Loading branch information
Maurizio Paglia authored Dec 5, 2022
1 parent 0312f7a commit 89d1f12
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pelican/plugins/share_post/share_post.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ def create_link_diaspora(title, url, content):
def create_link_facebook(title, url, content):
return f"https://www.facebook.com/sharer/sharer.php?u={url}"

@create_link
def create_link_mastodon(title, url, content):
tags = getattr(content, "tags", [])
tags = ", ".join([tag.slug for tag in tags])
hashtags = f"&hashtags={tags}" if tags else ""
return f"https://toot.kytta.dev/?text={title}&url={url}{hashtags}"


@create_link
def create_link_twitter(title, url, content):
Expand Down

0 comments on commit 89d1f12

Please sign in to comment.