mirror of
https://github.com/pelican-plugins/share-post.git
synced 2025-10-15 17:08:54 +02:00
Adjust code to comply with Ruff code style rules
This commit is contained in:
parent
d7c2f2bf1f
commit
897206b8b8
3 changed files with 5 additions and 9 deletions
|
|
@ -1 +1 @@
|
||||||
from .share_post import * # noqa
|
from .share_post import * # noqa: F403,PGH004,RUF100
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,4 @@
|
||||||
"""
|
"""Share Post plugin for Pelican.
|
||||||
Share Post
|
|
||||||
==========
|
|
||||||
|
|
||||||
This plugin was originally created by
|
This plugin was originally created by
|
||||||
Talha Mansoor <talha131@gmail.com>
|
Talha Mansoor <talha131@gmail.com>
|
||||||
|
|
@ -111,10 +109,10 @@ def create_share_links(content):
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
sub_title = ""
|
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"]
|
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 = {}
|
content.share_post = {}
|
||||||
for func in _create_link_functions:
|
for func in _create_link_functions:
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from share_post import run_plugin
|
|
||||||
|
|
||||||
from pelican.generators import ArticlesGenerator
|
from pelican.generators import ArticlesGenerator
|
||||||
from pelican.tests.support import get_context, get_settings
|
from pelican.tests.support import get_context, get_settings
|
||||||
|
|
||||||
|
|
@ -26,7 +24,7 @@ def test_share_post(tmp_folder):
|
||||||
)
|
)
|
||||||
generator.generate_context()
|
generator.generate_context()
|
||||||
|
|
||||||
run_plugin([generator])
|
share_post.run_plugin([generator])
|
||||||
|
|
||||||
share_links = generator.articles[0].share_post
|
share_links = generator.articles[0].share_post
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue