Skip to content

🚜 Improve the news links in the header menu and on the homepage - #3092

Merged
JacobCoffee merged 17 commits into
mainfrom
blogs-latest-news-links
Sep 19, 2026
Merged

JacobCoffee merged 17 commits into
mainfrom
blogs-latest-news-links

Conversation

@jefftriplett

@jefftriplett jefftriplett commented Aug 14, 2026

Copy link
Copy Markdown
Member

The Latest News section on python.org aggregates posts from several different sources, but its “More” link currently sends people to the newer blog.python.org site. That is confusing because not all of the news shown on python.org appears there. In particular, PSF announcements, election information, and other posts published through the PSF blog can be easy to miss unless someone already knows to visit pyfound.blogspot.com.

This PR makes the News section and menu a little clearer:

  • Changes the homepage “More” link to point to /blogs/, the existing python.org page that aggregates these sources.
  • Expands /blogs/ from 6 entries to 15. The newest entry is used as the page header, with the other 14 shown in the list.
  • Restyles the /blogs/ list to match the homepage Latest News widget: the date sits in its own column next to the title, instead of leaving a large empty gap with the title and date pushed into a second column.
  • Drops the “More” link from /blogs/ itself. That page already aggregates every source, so there was no single “more” to point at. A News Sources widget in the right column, below Python Insider Subscriptions, now links to each site instead: Python Insider, the PSF Blog, the PyCon Blog, and the PyPI Blog.

The homepage Latest News widget itself still shows 5 entries; only its link destination changes.

This PR no longer touches the fixtures. The News menu updates (the Python Insider item, the wording, the HTTPS links, and hiding the Python Brochure entry) and the blogs-copyright box are applied directly to the live rows in the admin, since fixtures are seed data and do not update existing databases.

Copilot AI lite review requested due to automatic review settings August 14, 2026 00:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aligns the homepage “Latest News” More link destination with the site’s aggregated news feed by pointing it to the local /blogs/ page, and increases the number of entries shown on that /blogs/ page.

Changes:

  • Update the homepage “More” link to use the internal blog URL instead of BLOG_URL.
  • Increase /blogs/ page entry list size from 5 to 10 (by fetching ENTRY_LIST_LIMIT + 1 to support a featured header entry).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
templates/components/blog-posts.html Updates “More” to reverse the internal blog URL.
apps/blogs/views.py Adds ENTRY_LIST_LIMIT = 10 and expands the BlogHome queryset slice accordingly.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread apps/blogs/views.py Outdated
Copilot AI review requested due to automatic review settings August 14, 2026 00:59
@jefftriplett jefftriplett changed the title Show 10 news entries on /blogs/ and point the homepage More link there Improve the news links in the header menu and on the homepage Aug 14, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

Suppressed comments (3)

apps/blogs/views.py:21

  • There is an extra space after the slice colon ([: ENTRY_LIST_LIMIT + 1]). This is inconsistent with typical formatting and may trigger linting (e.g., flake8 E203) depending on project config.
        entries = BlogEntry.objects.order_by("-pub_date")[: ENTRY_LIST_LIMIT + 1]

apps/blogs/views.py:22

  • The view behavior change increases the number of blog entries surfaced on the blog homepage (from 6 total to ENTRY_LIST_LIMIT + 1). The existing view test asserts the latest entry but doesn’t assert how many entries are exposed in resp.context["entries"], so this change isn’t guarded against regressions.
    def get_context_data(self, **kwargs):
        """Return the latest blog entries for the blog homepage."""
        context = super().get_context_data(**kwargs)

        entries = BlogEntry.objects.order_by("-pub_date")[: ENTRY_LIST_LIMIT + 1]
        latest_entry = None

templates/components/blog-posts.html:8

  • The homepage "Latest News" component is still fetching only 5 entries (limit=5), but the PR description says this section should show 10. This currently doesn’t implement the intended behavior.
                                {% get_latest_blog_entries limit=5 as entries %}

Copilot AI review requested due to automatic review settings August 14, 2026 01:02
@jefftriplett jefftriplett changed the title Improve the news links in the header menu and on the homepage 🚜 Improve the news links in the header menu and on the homepage Aug 14, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

Suppressed comments (1)

fixtures/boxes.json:467

  • This fixture still links to Python Insider over plain HTTP (http://blog.python.org). Since this PR is explicitly moving external links to HTTPS, this should also be updated to avoid mixed/insecure links.
      "content": "<h2 class=\"widget-title\">Copyright</h2>\r\n<p>Python Insider by the Python core team is licensed under a <a href=\"https://creativecommons.org/licenses/by-nc-sa/3.0/us/\">Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License</a>. Based on a work at <a href=\"http://blog.python.org\">blog.python.org</a>.</p>",
      "content_markup_type": "html",
      "_content_rendered": "<h2 class=\"widget-title\">Copyright</h2>\r\n<p>Python Insider by the Python core team is licensed under a <a href=\"https://creativecommons.org/licenses/by-nc-sa/3.0/us/\">Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License</a>. Based on a work at <a href=\"http://blog.python.org\">blog.python.org</a>.</p>"

Copilot AI review requested due to automatic review settings August 14, 2026 01:04
@jefftriplett
jefftriplett force-pushed the blogs-latest-news-links branch from 0b37d16 to 8b28a1f Compare August 14, 2026 01:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

Suppressed comments (2)

fixtures/boxes.json:467

  • The updated blogs copyright box still links to http://blog.python.org, even though the project’s configured blog URL is HTTPS and this PR is moving external links to HTTPS. Update the link to https://blog.python.org in both content and _content_rendered.
      "content": "<h2 class=\"widget-title\">Copyright</h2>\r\n<p>Python Insider by the Python core team is licensed under a <a href=\"https://creativecommons.org/licenses/by-nc-sa/3.0/us/\">Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License</a>. Based on a work at <a href=\"http://blog.python.org\">blog.python.org</a>.</p>",
      "content_markup_type": "html",
      "_content_rendered": "<h2 class=\"widget-title\">Copyright</h2>\r\n<p>Python Insider by the Python core team is licensed under a <a href=\"https://creativecommons.org/licenses/by-nc-sa/3.0/us/\">Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License</a>. Based on a work at <a href=\"http://blog.python.org\">blog.python.org</a>.</p>"

apps/blogs/views.py:9

  • ENTRY_LIST_LIMIT = 10 currently results in only 9 items in the “Latest News” list on /blogs/ because the newest entry is moved into the page header (other_entries = entries[1:]). If the intent is to show 10 list items (as before: query size = list size + 1), fetch one extra entry and slice using a dedicated query-limit constant.
# Number of entries the page shows. The newest one goes in the page
# header, the rest go in the "Latest News" list.
ENTRY_LIST_LIMIT = 10

Copilot AI review requested due to automatic review settings August 14, 2026 01:21

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

Suppressed comments (2)

templates/components/blog-posts.html:8

  • PR description says the homepage widget should show 10 news entries instead of 5, but this template tag still limits the list to 5.
                                {% get_latest_blog_entries limit=5 as entries %}

apps/blogs/views.py:21

  • ENTRY_LIST_LIMIT = 10 currently results in 9 items in the "Latest News" list because the template treats the first entry as the separate header item (other_entries = entries[1:]). If the intent is 10 list items (i.e., matching the prior behavior where [:6] produced 5 list items), the query needs to fetch one extra entry; otherwise, consider updating the constant/docstring/PR description to make it explicit that 10 is the total (1 header + 9 list).
        entries = BlogEntry.objects.order_by("-pub_date")[:ENTRY_LIST_LIMIT]

Copilot AI review requested due to automatic review settings August 14, 2026 01:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

@jefftriplett
jefftriplett force-pushed the blogs-latest-news-links branch from 5a7ce27 to 4a79a1e Compare August 18, 2026 20:14
Copilot AI review requested due to automatic review settings August 18, 2026 20:14

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

Suppressed comments (1)

apps/blogs/views.py:9

  • ENTRY_LIST_LIMIT is described/used as the total number of entries shown on the page (header entry + list items), but the name reads like it only limits the list portion. Renaming to something like ENTRY_PAGE_LIMIT/BLOG_HOME_ENTRY_COUNT would make the intent clearer and avoid off-by-one confusion when using ENTRY_LIST_LIMIT - 1 for the list size in tests.
# Number of entries the page shows. The newest one goes in the page
# header, the rest go in the "Latest News" list.
ENTRY_LIST_LIMIT = 10

hugovk
hugovk previously approved these changes Sep 2, 2026

@hugovk hugovk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, nice improvement.

  • Clarifies the Python News menu wording so it is clearer that it points to the aggregated /blogs/ page rather than directly to Python Insider.

Where's this one? I didn't spot it.

Comment thread apps/blogs/tests/test_views.py Outdated
Comment thread apps/blogs/tests/test_views.py Outdated
Copilot AI review requested due to automatic review settings September 2, 2026 12:49
Copilot AI review requested due to automatic review settings September 17, 2026 14:36
@jefftriplett
jefftriplett force-pushed the blogs-latest-news-links branch from 907da6f to 62be402 Compare September 17, 2026 14:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The changes are cohesive, low-risk, and include targeted tests covering the updated /blogs/ behavior and new source-link expectations.

Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

JacobCoffee
JacobCoffee previously approved these changes Sep 19, 2026
Comment thread apps/blogs/templates/blogs/index.html Outdated
Comment thread apps/blogs/templates/blogs/index.html
@JacobCoffee
JacobCoffee dismissed stale reviews from hugovk and themself via 5f0fb55 September 19, 2026 17:03
Copilot AI review requested due to automatic review settings September 19, 2026 17:03

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The /blogs/ “News Sources” widget currently links to the PyPI Blog, but the PR description and tests expect a Planet Python link, which will cause test failure and a UX mismatch.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity

Open (1)

Comment thread apps/blogs/templates/blogs/index.html
Copilot AI review requested due to automatic review settings September 19, 2026 18:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

The /blogs/ list introduces heading markup in each list item, which can negatively affect accessibility and breaks consistency with the existing widget markup/CSS expectations.

Review effort: Lite
Findings: 1 High severity

Open (1)
Previously missed (2)

In code that hasn't changed since last review

Medium severity Avoid wrapping news links in unnecessary h3 headings

apps/​blogs/​templates/​blogs/​index.html:33

Wrapping each news link in an

adds many headings to the page and breaks consistency with the existing widget pattern (e.g., templates/components/blog-posts.html and event-posts.html render the date tag followed by a plain link). This can clutter screen-reader heading navigation and is unnecessary for styling; prefer rendering the link directly after the time tag and style the via CSS.

Low severity Style direct news links instead of targeting h3 elements

static/​css/​style.css:2293

This selector styles an

inside .most-recent-posts list items, but the shared widget markup pattern uses a direct child (time + link). Styling the keeps the layout consistent across the homepage Latest News widget and /blogs/ and avoids needing heading markup just for typography.

Copilot AI review requested due to automatic review settings September 19, 2026 19:23

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The changes align with the stated UX goals and include targeted tests to lock in the new /blogs/ behavior.

Review effort: Lite
Findings: None

Resolved since last review (1)

@JacobCoffee
JacobCoffee merged commit bf13c9e into main Sep 19, 2026
14 checks passed
@JacobCoffee
JacobCoffee deleted the blogs-latest-news-links branch September 19, 2026 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants