Static Page Generator #5

Merged
kumi merged 21 commits from dev into main 2024-07-06 14:07:00 +00:00
2 changed files with 9 additions and 1 deletions
Showing only changes of commit 5cdb9ad43b - Show all commits

View file

@ -34,6 +34,14 @@ def icon(icon_name):
env.filters["icon"] = icon env.filters["icon"] = icon
# Filter for rendering a month name from a number
def month_name(month_number):
return datetime.date(1900, int(month_number), 1).strftime("%B")
env.filters["month_name"] = month_name
def render_template_to_file(template_name, output_name, **kwargs): def render_template_to_file(template_name, output_name, **kwargs):
try: try:
template = env.get_template(template_name) template = env.get_template(template_name)

View file

@ -14,7 +14,7 @@
{% for month, month_data in year_data.items() %} {% for month, month_data in year_data.items() %}
<div class="card shadow-sm mt-4"> <div class="card shadow-sm mt-4">
<div class="card-body"> <div class="card-body">
<h5 class="card-title">Transparency Report for {{ month }}/{{ year }}</h5> <h5 class="card-title">Transparency Report for {{ month|month_name }} {{ year }}</h5>
<div class="table-responsive">{{ month_data|safe }}</div> <div class="table-responsive">{{ month_data|safe }}</div>
</div> </div>
</div> </div>