diff --git a/pelican/plugins/share_post/share_post.py b/pelican/plugins/share_post/share_post.py index 35deb80..c6a8abb 100644 --- a/pelican/plugins/share_post/share_post.py +++ b/pelican/plugins/share_post/share_post.py @@ -57,10 +57,16 @@ def create_link_facebook(title, url, content): @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}" + if hasattr(content, 'tags'): + taglist = content.tags + new_taglist = [] + for i in taglist: + new_taglist.append('#' + str(i)) + hashtags = ' '.join(str(x).replace(" ", "") for x in new_taglist) + else: + hashtags = '' + + return f"https://toot.kytta.dev/?text={title}{newline}{url}{newline}{hashtags}" @create_link