pelican-avatar 1.0.5__py3-none-any.whl → 1.0.8__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pelican-avatar might be problematic. Click here for more details.
- {pelican_avatar-1.0.5.dist-info → pelican_avatar-1.0.8.dist-info}/METADATA +13 -11
- pelican_avatar-1.0.8.dist-info/RECORD +5 -0
- {pelican_avatar-1.0.5.dist-info → pelican_avatar-1.0.8.dist-info}/WHEEL +1 -1
- pelican/plugins/avatar/__init__.py +0 -1
- pelican/plugins/avatar/avatar.py +0 -88
- pelican_avatar-1.0.5.dist-info/RECORD +0 -7
- {pelican_avatar-1.0.5.dist-info → pelican_avatar-1.0.8.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pelican-avatar
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.8
|
|
4
4
|
Summary: Libravatar/Gravatar plugin for Pelican
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Project-URL: Funding, https://donate.getpelican.com/
|
|
8
|
-
Author-email: Rafael Laboissière <rafael@laboissiere.net>
|
|
5
|
+
Keywords: pelican plugin libravatar gravatar
|
|
6
|
+
Author-Email: Rafael Laboissière <rafael@laboissiere.net>
|
|
9
7
|
License: AGPL-3.0
|
|
10
|
-
License-File: LICENSE
|
|
11
|
-
Keywords: gravatar,libravatar,pelican,plugin
|
|
12
8
|
Classifier: Development Status :: 5 - Production/Stable
|
|
13
9
|
Classifier: Environment :: Console
|
|
14
10
|
Classifier: Framework :: Pelican
|
|
@@ -21,15 +17,19 @@ Classifier: Programming Language :: Python :: 3.8
|
|
|
21
17
|
Classifier: Programming Language :: Python :: 3.9
|
|
22
18
|
Classifier: Programming Language :: Python :: 3.10
|
|
23
19
|
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
24
21
|
Classifier: Topic :: Internet :: WWW/HTTP
|
|
25
22
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
23
|
+
Project-URL: Homepage, https://github.com/pelican-plugins/avatar
|
|
24
|
+
Project-URL: Issue tracker, https://github.com/pelican-plugins/avatar/issues
|
|
25
|
+
Project-URL: Funding, https://donate.getpelican.com/
|
|
26
26
|
Requires-Python: <4.0,>=3.8.1
|
|
27
|
-
Requires-Dist: libgravatar>=0.2.5
|
|
28
27
|
Requires-Dist: pelican>=4.5
|
|
28
|
+
Requires-Dist: libgravatar>=0.2.5
|
|
29
29
|
Requires-Dist: py3dns>=3.2
|
|
30
30
|
Requires-Dist: pylibravatar>=1.7
|
|
31
|
+
Requires-Dist: markdown>=3.4; extra == "markdown"
|
|
31
32
|
Provides-Extra: markdown
|
|
32
|
-
Requires-Dist: markdown>=3.4; extra == 'markdown'
|
|
33
33
|
Description-Content-Type: text/markdown
|
|
34
34
|
|
|
35
35
|
Avatar: A Plugin for Pelican
|
|
@@ -157,15 +157,17 @@ To start contributing to this plugin, review the [Contributing to Pelican][] doc
|
|
|
157
157
|
Acknowledgments
|
|
158
158
|
---------------
|
|
159
159
|
|
|
160
|
-
Thanks to [Justin Mayer][] for helping with migration of this plugin under the Pelican Plugins organization
|
|
160
|
+
Thanks to [Justin Mayer][] for helping with migration of this plugin under the Pelican Plugins organization, to [Troy Curtis][] for adding support for page generator and global generator context and for making improvements in the Poetry workflow, to [Lucas Cimon][] for fixes in the test suit and in the CI support, and to [Christian Clauss][] for Python 3 porting.
|
|
161
161
|
|
|
162
162
|
[Justin Mayer]: https://github.com/justinmayer
|
|
163
163
|
[Troy Curtis]: https://github.com/troycurtisjr
|
|
164
|
+
[Lucas Cimon]: https://github.com/Lucas-C
|
|
165
|
+
[Christian Clauss]: https://github.com/cclauss
|
|
164
166
|
|
|
165
167
|
Author
|
|
166
168
|
------
|
|
167
169
|
|
|
168
|
-
Copyright (C) 2015, 2021-
|
|
170
|
+
Copyright (C) 2015, 2021-2024 Rafael Laboissière (<rafael@laboissiere.net>)
|
|
169
171
|
|
|
170
172
|
License
|
|
171
173
|
-------
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
pelican_avatar-1.0.8.dist-info/METADATA,sha256=moAqqvUJzexH52upKopx_BTWAZpC9lftSHhkGohMR70,6813
|
|
2
|
+
pelican_avatar-1.0.8.dist-info/WHEEL,sha256=N2J68yzZqJh3mI_Wg92rwhw0rtJDFpZj9bwQIMJgaVg,90
|
|
3
|
+
pelican_avatar-1.0.8.dist-info/licenses/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
|
|
4
|
+
tasks.py,sha256=vSB2IaG--1O3QmrCUYQt_ZXF2r3b7t3uRheSmhQ5MPA,3164
|
|
5
|
+
pelican_avatar-1.0.8.dist-info/RECORD,,
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
from .avatar import * # NOQA: F403
|
pelican/plugins/avatar/avatar.py
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
"""Avatar plugin for Pelican."""
|
|
2
|
-
|
|
3
|
-
# Copyright (C) 2015, 2021-2023 Rafael Laboissière <rafael@laboissiere.net>
|
|
4
|
-
#
|
|
5
|
-
# This program is free software: you can redistribute it and/or modify it
|
|
6
|
-
# under the terms of the GNU General Affero Public License as published by
|
|
7
|
-
# the Free Software Foundation, either version 3 of the License, or (at
|
|
8
|
-
# your option) any later version.
|
|
9
|
-
#
|
|
10
|
-
# This program is distributed in the hope that it will be useful, but
|
|
11
|
-
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
13
|
-
# Affero General Public License for more details.
|
|
14
|
-
#
|
|
15
|
-
# You should have received a copy of the GNU Affero General Public License
|
|
16
|
-
# along with this program. If not, see http://www.gnu.org/licenses/.
|
|
17
|
-
|
|
18
|
-
from libgravatar import Gravatar
|
|
19
|
-
from libravatar import libravatar_url
|
|
20
|
-
|
|
21
|
-
from pelican import signals
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
def initialize(pelicanobj):
|
|
25
|
-
"""Initialize the Avatar plugin."""
|
|
26
|
-
pelicanobj.settings.setdefault("AVATAR_MISSING", None)
|
|
27
|
-
pelicanobj.settings.setdefault("AVATAR_SIZE", None)
|
|
28
|
-
pelicanobj.settings.setdefault("AVATAR_USE_GRAVATAR", None)
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
def gen_avatar_url(settings, email):
|
|
32
|
-
"""Generate the appropriate libravatar/gravatar URL based on the provided email."""
|
|
33
|
-
# Early exit if there is nothing to do
|
|
34
|
-
if not email:
|
|
35
|
-
return None
|
|
36
|
-
|
|
37
|
-
missing = settings.get("AVATAR_MISSING")
|
|
38
|
-
size = settings.get("AVATAR_SIZE")
|
|
39
|
-
|
|
40
|
-
email = email.lower()
|
|
41
|
-
# Compose URL
|
|
42
|
-
if settings.get("AVATAR_USE_GRAVATAR"):
|
|
43
|
-
url = Gravatar(email).get_image()
|
|
44
|
-
else:
|
|
45
|
-
url = libravatar_url(email)
|
|
46
|
-
|
|
47
|
-
# Add eventual "missing picture" option
|
|
48
|
-
if missing or size:
|
|
49
|
-
url = url + "?"
|
|
50
|
-
if missing:
|
|
51
|
-
url = url + "d=" + missing
|
|
52
|
-
if size:
|
|
53
|
-
url = url + "&"
|
|
54
|
-
if size:
|
|
55
|
-
url = url + "s=" + str(size)
|
|
56
|
-
return url
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
def add_avatar_context(generator):
|
|
60
|
-
"""Add generator context connector for Avatar plugin."""
|
|
61
|
-
# This adds the avatar URL to the global generator context based on the
|
|
62
|
-
# global setting.
|
|
63
|
-
email = generator.settings.get("AVATAR_AUTHOR_EMAIL")
|
|
64
|
-
url = gen_avatar_url(generator.settings, email)
|
|
65
|
-
if url:
|
|
66
|
-
generator.context["author_avatar"] = url
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
def add_avatar(generator, metadata):
|
|
70
|
-
"""Add Avatar URL to the article/page metadata."""
|
|
71
|
-
# Check the presence of the Email header
|
|
72
|
-
if "email" in metadata:
|
|
73
|
-
email = metadata["email"]
|
|
74
|
-
else:
|
|
75
|
-
email = generator.settings.get("AVATAR_AUTHOR_EMAIL")
|
|
76
|
-
|
|
77
|
-
url = gen_avatar_url(generator.settings, email)
|
|
78
|
-
if url:
|
|
79
|
-
# Add URL to the article/page metadata
|
|
80
|
-
metadata["author_avatar"] = url
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
def register():
|
|
84
|
-
"""Register the Avatar plugin with Pelican."""
|
|
85
|
-
signals.initialized.connect(initialize)
|
|
86
|
-
signals.article_generator_context.connect(add_avatar)
|
|
87
|
-
signals.page_generator_context.connect(add_avatar)
|
|
88
|
-
signals.generator_init.connect(add_avatar_context)
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
tasks.py,sha256=vSB2IaG--1O3QmrCUYQt_ZXF2r3b7t3uRheSmhQ5MPA,3164
|
|
2
|
-
pelican/plugins/avatar/__init__.py,sha256=tt8WB0hhhW_jgsRgQNEn-r3TKl1RJRglrXKeudL8zO0,36
|
|
3
|
-
pelican/plugins/avatar/avatar.py,sha256=QJlGVXNZhtslhKQdGBEWI5z1D8jqD8S75KmPOFQvRs0,2938
|
|
4
|
-
pelican_avatar-1.0.5.dist-info/METADATA,sha256=foiUd9OFU62cJeFWLeHpqTsEzHc9CvVoj7VO4DP2ciM,6580
|
|
5
|
-
pelican_avatar-1.0.5.dist-info/WHEEL,sha256=9QBuHhg6FNW7lppboF2vKVbCGTVzsFykgRQjjlajrhA,87
|
|
6
|
-
pelican_avatar-1.0.5.dist-info/licenses/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
|
|
7
|
-
pelican_avatar-1.0.5.dist-info/RECORD,,
|
|
File without changes
|