Added Mastodon share code

This commit is contained in:
Maurizio Paglia 2022-12-05 12:05:40 +01:00 committed by GitHub
commit 89d1f123e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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):