diff --git a/docs/en/index.md b/docs/en/index.md index dd13de2817..bc1905c8f7 100644 --- a/docs/en/index.md +++ b/docs/en/index.md @@ -122,7 +122,14 @@ BeeWare is supported by users like you! Every little bit helps: [click here to c ### Upcoming events -{{ upcoming_events(files) }} +{% set events = upcoming_events(files) %} +{% if events %} +{{ events }} +{% else %} + +Nothing at the moment... + +{% endif %} ### Documentation diff --git a/docs/en/stylesheets/beeware.css b/docs/en/stylesheets/beeware.css index ca5987b86f..aa2b544f81 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,11 @@ h1 .news { width: 13rem; } +.md-content--post > .md-content__inner, +.md-content__inner:has(.md-post) { + margin-top: 1.8rem; +} + .md-post__content h2:first-of-type { display: none; } @@ -553,6 +567,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) { diff --git a/docs/macros.py b/docs/macros.py index 7e5f7d7041..485a1755ad 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,14 +282,14 @@ 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})" ), ) ) 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):