diff --git a/assets/css/bpd.css b/assets/css/bpd.css index 14113e9..57411bd 100644 --- a/assets/css/bpd.css +++ b/assets/css/bpd.css @@ -639,7 +639,7 @@ button.next:focus { border: 1px solid #ddd; border-radius: 8px; background-color: #f9f9f9; - +} .latest-posts-grid { display: flex; flex-wrap: wrap; diff --git a/index.html b/index.html index 8e01244..485e1ef 100644 --- a/index.html +++ b/index.html @@ -2,7 +2,7 @@ layout: index lang: en title: Home -list_title: Recent news +list_title: Recent News ---

Our Mission

diff --git a/tests/test.py b/tests/test.py index e1e7e2e..ef14c85 100644 --- a/tests/test.py +++ b/tests/test.py @@ -140,7 +140,6 @@ def test_first_slide_matches_latest_post(page_url: tuple[Page, str]) -> None: "/blog", ), ) - def stem_description( path: pathlib.Path, ) -> Generator[tuple[str, frontmatter.Post], None, None]: @@ -171,3 +170,26 @@ def test_page_blog_posts( page.locator('meta[name="description"]').get_attribute("content") == frontmatter["description"] ) + + +def get_post_image(metadata, default_image="/assets/images/bpd_stacked.png"): + """Determine the image to display for a post.""" + return metadata.get("featured_image", default_image) + + +def test_default_image_displayed_for_post_without_featured_image(): + metadata = { + "title": "Test Post Without Featured Image", + "date": "2024-11-27", + "lang": "en", + "layout": "post", + "excerpt": "This is a test post for checking the default image.", + } + + default_image = "/assets/images/bpd_stacked.png" + + featured_image = get_post_image(metadata, default_image) + + # Assertions + assert metadata["title"] == "Test Post Without Featured Image" + assert featured_image == default_image