We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 108bfc3 commit 2825e18Copy full SHA for 2825e18
1 file changed
pelicanconf.py
@@ -15,6 +15,7 @@
15
jinja_fragments = Environment(loader=FileSystemLoader("theme/templates/fragments/"))
16
sponsor_template = jinja_fragments.get_template("sponsor.html")
17
SPONSOR_IMG_PATH = Path("content/images/sponsors/")
18
+SPONSOR_TAG_PATTERN = re.compile(r"(gold|silver|bronze)")
19
20
21
def sponsor_img(name: str) -> str:
@@ -26,6 +27,10 @@ def sponsor_img(name: str) -> str:
26
27
28
@LiquidTags.register("sponsors")
29
def sponsors(preprocessor: Preprocessor, tag: str, markup: str) -> str:
30
+ match = SPONSOR_TAG_PATTERN.search(markup)
31
+ assert match is not None
32
+ sponsor_group = match.group(1)
33
+
34
return sponsor_template.render(SPONSORS=SPONSORS)
35
36
0 commit comments