Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion docs/en/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
19 changes: 17 additions & 2 deletions docs/en/stylesheets/beeware.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand All @@ -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) {
Expand Down
6 changes: 3 additions & 3 deletions docs/macros.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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):
Expand Down