diff --git a/pelican/plugins/share_post/__init__.py b/pelican/plugins/share_post/__init__.py index 4185ce8..40c66ed 100644 --- a/pelican/plugins/share_post/__init__.py +++ b/pelican/plugins/share_post/__init__.py @@ -1 +1 @@ -from .share_post import * # noqa +from .share_post import * # noqa: F403,PGH004,RUF100 diff --git a/pelican/plugins/share_post/share_post.py b/pelican/plugins/share_post/share_post.py index f779c15..c27ad79 100644 --- a/pelican/plugins/share_post/share_post.py +++ b/pelican/plugins/share_post/share_post.py @@ -1,6 +1,4 @@ -""" -Share Post -========== +"""Share Post plugin for Pelican. This plugin was originally created by Talha Mansoor @@ -111,10 +109,10 @@ def create_share_links(content): except AttributeError: sub_title = "" - title = quote(f"{main_title}{sub_title}".encode("utf-8")) + title = quote(f"{main_title}{sub_title}".encode()) site_url = content.settings["SITEURL"] - url = quote(f"{site_url}/{content.url}".encode("utf-8")) + url = quote(f"{site_url}/{content.url}".encode()) content.share_post = {} for func in _create_link_functions: diff --git a/pelican/plugins/share_post/test_share_post.py b/pelican/plugins/share_post/test_share_post.py index a35fc59..e973e70 100644 --- a/pelican/plugins/share_post/test_share_post.py +++ b/pelican/plugins/share_post/test_share_post.py @@ -1,7 +1,5 @@ import os -from share_post import run_plugin - from pelican.generators import ArticlesGenerator from pelican.tests.support import get_context, get_settings @@ -26,7 +24,7 @@ def test_share_post(tmp_folder): ) generator.generate_context() - run_plugin([generator]) + share_post.run_plugin([generator]) share_links = generator.articles[0].share_post