Skip to content

Commit 6bc7ca9

Browse files
Update pelicanconf.py
1 parent a681783 commit 6bc7ca9

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

pelicanconf.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import logging
22
import re
33
from pathlib import Path
4+
from types import MappingProxyType
45

56
from jinja2 import Environment, FileSystemLoader
67
from markdown.extensions.admonition import AdmonitionExtension
@@ -31,7 +32,7 @@ def sponsors(preprocessor: Preprocessor, tag: str, markup: str) -> str:
3132
assert match is not None
3233
sponsor_group = match.group(1)
3334

34-
return sponsor_template.render(SPONSORS=SPONSORS)
35+
return sponsor_template.render(SPONSORS=SPONSORS[sponsor_group])
3536

3637

3738
SITENAME = "aio-libs"
@@ -44,11 +45,19 @@ def sponsors(preprocessor: Preprocessor, tag: str, markup: str) -> str:
4445
LOCALE = "en_US.utf8"
4546
TIMEZONE = "UTC"
4647

47-
_SPONSORS = (
48+
_SPONSORS_GOLD = (
4849
("Tidelift", "https://tidelift.com/"),
4950
("Open Home Foundation", "https://www.openhomefoundation.org/"),
5051
)
51-
SPONSORS = tuple({"name": s[0], "img": sponsor_img(s[0]), "url": s[1]} for s in _SPONSORS)
52+
_SPONSORS_SILVER = (
53+
("Test silver sponsor", "https://aiohttp.org/"),
54+
)
55+
_SPONSORS_BRONZE = ("dmTECH",)
56+
SPONSORS = MappingProxyType({
57+
"gold": tuple({"name": s[0], "img": sponsor_img(s[0]), "url": s[1]} for s in _SPONSORS_GOLD),
58+
"silver": tuple({"name": s[0], "url": s[1]} for s in _SPONSORS_SILVER),
59+
"bronze": tuple({"name": s for s in _SPONSORS_BRONZE})
60+
})
5261

5362
# URL settings
5463
FILENAME_METADATA = r"(?P<date>\d{4}-\d{2}-\d{2})_(?P<slug>.*)"

0 commit comments

Comments
 (0)