From 5f5c7340567cf4640924a54d102425a5c4f5f147 Mon Sep 17 00:00:00 2001 From: Kattni Date: Mon, 9 Mar 2026 21:01:05 -0400 Subject: [PATCH 1/5] Fixes upcoming events rendering on homepage. --- docs/macros.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/macros.py b/docs/macros.py index 7e5f7d7041..42fc6a4ed2 100644 --- a/docs/macros.py +++ b/docs/macros.py @@ -268,7 +268,7 @@ def upcoming_events(files): ): metadata = get_metadata(file_data.content_string) - if metadata["event"]["date"] < datetime.date.today(): + if metadata["event"]["date"] > datetime.date.today(): if metadata["event"]["date"] == metadata["event"]["end_date"]: event_date = metadata["event"]["date"].strftime("%B %d, %Y") else: @@ -282,7 +282,7 @@ def upcoming_events(files): metadata["event"]["date"], ( f"- [{metadata['event']['name']}" - f": {event_date}]({file_data.src_path})", + f": {event_date}]({file_data.src_path})" ), ) ) From 4a0637c53781748e376a6e691e79a7fdb9bc7a5f Mon Sep 17 00:00:00 2001 From: Kattni Date: Mon, 9 Mar 2026 21:07:49 -0400 Subject: [PATCH 2/5] Move string to Markdown for translation purposes. --- docs/en/index.md | 8 ++++++++ docs/macros.py | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/en/index.md b/docs/en/index.md index dd13de2817..2caef39641 100644 --- a/docs/en/index.md +++ b/docs/en/index.md @@ -122,8 +122,16 @@ BeeWare is supported by users like you! Every little bit helps: [click here to c ### Upcoming events +{% if upcoming_events(files) == None %} + +Nothing at the moment... + +{% else %} + {{ upcoming_events(files) }} +{% endif %} + ### Documentation
diff --git a/docs/macros.py b/docs/macros.py index 42fc6a4ed2..485a1755ad 100644 --- a/docs/macros.py +++ b/docs/macros.py @@ -289,7 +289,7 @@ def upcoming_events(files): if events: return "\n".join(item[1] for item in sorted(events)[:5]) - return "Nothing at the moment..." + return None @env.macro def latest_news(files): From ab1aab1ece361441c5ce351ea8699b027f0f7b92 Mon Sep 17 00:00:00 2001 From: Kattni Date: Mon, 9 Mar 2026 22:37:30 -0400 Subject: [PATCH 3/5] Layout fixes. --- docs/en/stylesheets/beeware.css | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/docs/en/stylesheets/beeware.css b/docs/en/stylesheets/beeware.css index ca5987b86f..7e91222d1d 100644 --- a/docs/en/stylesheets/beeware.css +++ b/docs/en/stylesheets/beeware.css @@ -59,8 +59,12 @@ md-path__list > .md-path__item > .md-path__link { margin-right: 6.7%; } -/* This forces all main content EXCEPT the index page to be 45rem wide */ -.md-sidebar--primary:is([hidden]) ~ .md-content:not(:has(.md-content__inner .index-page)) { +/* This forces all main content EXCEPT the index and blog pages to be 45rem wide */ +/* The blog page includes the blog left sidebar in the width, and needs to be ignored */ +/* Docs page has its own width limits, and is ignored here. */ +.md-sidebar--primary:is([hidden]) ~ .md-content:not(:has(.index-page, .md-sidebar--post)) .md-content__inner:not(:has(.docs-page)), +.md-post__content, +.md-content--post > .md-content__inner { max-width: 45rem; } @@ -339,6 +343,11 @@ a.index-main-keep { min-width: 15rem; } +/* The right sidebar when not on blog pages */ +.md-sidebar--secondary:has(+ :not(.md-content--post)) { + margin-right: 5.5%; +} + h2#sidebar { margin-top: 0rem; } @@ -537,6 +546,10 @@ h1 .news { width: 13rem; } +.md-content--post > .md-content__inner { + margin-top: 1.8rem; +} + .md-post__content h2:first-of-type { display: none; } @@ -553,6 +566,7 @@ h1 .news { .md-sidebar--primary:is([hidden]) ~ .md-content.md-content--post { margin-left: 0; margin-right: 0; + max-width: fit-content; } @media screen and (min-width: 76.25em) { From 3f270f112fc0dadd19138c6955a643a8d42abf8a Mon Sep 17 00:00:00 2001 From: Kattni Date: Tue, 10 Mar 2026 02:36:21 -0400 Subject: [PATCH 4/5] Add header buffer to blog indices. --- docs/en/stylesheets/beeware.css | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/en/stylesheets/beeware.css b/docs/en/stylesheets/beeware.css index 7e91222d1d..aa2b544f81 100644 --- a/docs/en/stylesheets/beeware.css +++ b/docs/en/stylesheets/beeware.css @@ -546,7 +546,8 @@ h1 .news { width: 13rem; } -.md-content--post > .md-content__inner { +.md-content--post > .md-content__inner, +.md-content__inner:has(.md-post) { margin-top: 1.8rem; } From 80e5d040e3b84beaf6e8484c8541d7013cdf6c1d Mon Sep 17 00:00:00 2001 From: Kattni Date: Tue, 10 Mar 2026 02:37:28 -0400 Subject: [PATCH 5/5] Update macro call. --- docs/en/index.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/docs/en/index.md b/docs/en/index.md index 2caef39641..bc1905c8f7 100644 --- a/docs/en/index.md +++ b/docs/en/index.md @@ -122,13 +122,12 @@ BeeWare is supported by users like you! Every little bit helps: [click here to c ### Upcoming events -{% if upcoming_events(files) == None %} - -Nothing at the moment... - +{% set events = upcoming_events(files) %} +{% if events %} +{{ events }} {% else %} -{{ upcoming_events(files) }} +Nothing at the moment... {% endif %}