aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/apps/timeline/apps.py
diff options
context:
space:
mode:
authorGravatar hedy <[email protected]>2024-04-06 12:56:13 +0800
committerGravatar ~hedy <[email protected]>2024-05-24 12:46:13 +0800
commit046199eb91008ba79170b58406a7fadc43f193ab (patch)
tree89c57a948861bd29f374acb627972d6fa7590976 /pydis_site/apps/timeline/apps.py
parentTimeline: Move the new timeline.css in and have git recognize the rename (diff)
Timeline: Use pydis blurple as default icon background color
Diffstat (limited to 'pydis_site/apps/timeline/apps.py')
-rw-r--r--pydis_site/apps/timeline/apps.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/pydis_site/apps/timeline/apps.py b/pydis_site/apps/timeline/apps.py
index 8f27297f..37a61e93 100644
--- a/pydis_site/apps/timeline/apps.py
+++ b/pydis_site/apps/timeline/apps.py
@@ -28,14 +28,19 @@ class TimelineConfig(AppConfig):
# Strip `.md` file extension from filename and split it into the
# date (for sorting) and slug (for linking).
key, slug = path.name[:-3].split("_")
+
+ icon_color = metadata.get("icon_color")
+ # Use the pydis blurple as the default background color.
+ if not icon_color or metadata["icon"] == "pydis":
+ icon_color = "has-background-primary"
+
entry = {
"key": key,
"slug": slug,
"title": metadata["title"],
"date": metadata["date"],
"icon": metadata["icon"],
- # This key might not be used if the icon uses the pydis logo.
- "icon_color": metadata.get("icon_color"),
+ "icon_color": icon_color,
"content": html,
}