feat: add build date to footer

Displays the UTC date the site was last built in the footer so visitors
can see how fresh the data is.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Vinta Chen
2026-03-22 15:30:04 +08:00
parent 97f18d295f
commit d3070b735e
3 changed files with 17 additions and 1 deletions

View File

@@ -4,6 +4,7 @@
import json
import re
import shutil
from datetime import datetime, timezone
from pathlib import Path
from typing import TypedDict
@@ -191,6 +192,7 @@ def build(repo_root: str) -> None:
entries=entries,
total_entries=total_entries,
total_categories=len(categories),
build_date=datetime.now(timezone.utc).strftime("%B %d, %Y"),
),
encoding="utf-8",
)

View File

@@ -908,12 +908,23 @@ th[data-sort].sort-asc::after {
text-underline-offset: 0.2em;
}
.footer-left {
display: flex;
flex-direction: column;
gap: 0.3rem;
}
.footer-brand {
font-weight: 700;
letter-spacing: 0.03em;
color: oklch(82% 0.02 75);
}
.footer-date {
font-size: 0.7rem;
color: oklch(50% 0.02 55);
}
.footer-links {
display: block;
text-align: right;

View File

@@ -44,7 +44,10 @@
<main id="content">{% block content %}{% endblock %}</main>
<footer class="footer">
<span class="footer-brand">Awesome Python</span>
<div class="footer-left">
<span class="footer-brand">Awesome Python</span>
{% if build_date %}<span class="footer-date">Data refreshed {{ build_date }}</span>{% endif %}
</div>
<div class="footer-links">
<span
>Made by