Skip to content

Commit 046199e

Browse files
committed
Timeline: Use pydis blurple as default icon background color
1 parent 93c5ca6 commit 046199e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

pydis_site/apps/timeline/apps.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,19 @@ def ready(self) -> None:
2828
# Strip `.md` file extension from filename and split it into the
2929
# date (for sorting) and slug (for linking).
3030
key, slug = path.name[:-3].split("_")
31+
32+
icon_color = metadata.get("icon_color")
33+
# Use the pydis blurple as the default background color.
34+
if not icon_color or metadata["icon"] == "pydis":
35+
icon_color = "has-background-primary"
36+
3137
entry = {
3238
"key": key,
3339
"slug": slug,
3440
"title": metadata["title"],
3541
"date": metadata["date"],
3642
"icon": metadata["icon"],
37-
# This key might not be used if the icon uses the pydis logo.
38-
"icon_color": metadata.get("icon_color"),
43+
"icon_color": icon_color,
3944
"content": html,
4045
}
4146

0 commit comments

Comments
 (0)