From af05feb7424def4e2ca04e11260db609fd7f68bf Mon Sep 17 00:00:00 2001 From: Jeff Triplett Date: Thu, 13 Aug 2026 20:04:50 -0500 Subject: [PATCH 1/3] Improve the news links in the header menu and on the homepage Add a Python Insider link to the News menu, point the homepage More link at /blogs/ instead of the external blog, and show 10 entries there instead of 6. Also switch the external nav links to https and clarify the Python News wording, since that item goes to /blogs/ and not to Python Insider. --- apps/blogs/views.py | 6 +++- fixtures/boxes.json | 4 +-- fixtures/sitetree_menus.json | 46 +++++++++++++++++++++------- templates/components/blog-posts.html | 2 +- 4 files changed, 43 insertions(+), 15 deletions(-) diff --git a/apps/blogs/views.py b/apps/blogs/views.py index 1750dfc99..c44d30492 100644 --- a/apps/blogs/views.py +++ b/apps/blogs/views.py @@ -4,6 +4,10 @@ from apps.blogs.models import BlogEntry +# 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 + class BlogHome(TemplateView): """Main blog view.""" @@ -14,7 +18,7 @@ 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")[:6] + entries = BlogEntry.objects.order_by("-pub_date")[:ENTRY_LIST_LIMIT] latest_entry = None other_entries = [] diff --git a/fixtures/boxes.json b/fixtures/boxes.json index b903f7b23..d6f927cf3 100644 --- a/fixtures/boxes.json +++ b/fixtures/boxes.json @@ -462,9 +462,9 @@ "created": "2014-02-13T18:27:05.680Z", "updated": "2014-07-20T16:51:28.177Z", "label": "blogs-copyright", - "content": "

Copyright

\r\n

Python Insider by the Python Core Developers is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. Based on a work at blog.python.org.

", + "content": "

Copyright

\r\n

Python Insider by the Python core team is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. Based on a work at blog.python.org.

", "content_markup_type": "html", - "_content_rendered": "

Copyright

\r\n

Python Insider by the Python Core Developers is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. Based on a work at blog.python.org.

" + "_content_rendered": "

Copyright

\r\n

Python Insider by the Python core team is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. Based on a work at blog.python.org.

" } }, { diff --git a/fixtures/sitetree_menus.json b/fixtures/sitetree_menus.json index 99fc1af6b..3bdd96eef 100644 --- a/fixtures/sitetree_menus.json +++ b/fixtures/sitetree_menus.json @@ -1189,7 +1189,7 @@ "fields": { "title": "PSF Blog", "hint": "", - "url": "http://pyfound.blogspot.com/", + "url": "https://pyfound.blogspot.com/", "urlaspattern": false, "tree": 1, "hidden": false, @@ -2076,13 +2076,13 @@ "pk": 96, "fields": { "title": "Python News", - "hint": "Python Insider Blog Posts", + "hint": "Python news and blog posts", "url": "blog", "urlaspattern": true, "tree": 1, "hidden": false, "alias": null, - "description": "Python Insider is the blog used by the Python Core Developers to announce news related to the Python programming language.", + "description": "News about the Python programming language, including posts from Python Insider, the blog of the Python core team.", "inmenu": true, "inbreadcrumbs": true, "insitetree": true, @@ -2095,13 +2095,37 @@ "access_permissions": [] } }, +{ + "model": "sitetree.treeitem", + "pk": 126, + "fields": { + "title": "Python Insider", + "hint": "News and updates from the Python core team", + "url": "https://blog.python.org/", + "urlaspattern": false, + "tree": 1, + "hidden": false, + "alias": null, + "description": "Python Insider carries news and updates from the Python core team.", + "inmenu": true, + "inbreadcrumbs": true, + "insitetree": true, + "access_loggedin": false, + "access_guest": false, + "access_restricted": false, + "access_perm_type": 1, + "parent": 12, + "sort_order": 97, + "access_permissions": [] + } +}, { "model": "sitetree.treeitem", "pk": 97, "fields": { "title": "PSF News", "hint": "PSF Blog", - "url": "http://pyfound.blogspot.com/", + "url": "https://pyfound.blogspot.com/", "urlaspattern": false, "tree": 1, "hidden": false, @@ -2115,7 +2139,7 @@ "access_restricted": false, "access_perm_type": 1, "parent": 12, - "sort_order": 98, + "sort_order": 99, "access_permissions": [] } }, @@ -2125,7 +2149,7 @@ "fields": { "title": "Community News", "hint": "Planet Python", - "url": "http://planetpython.org/", + "url": "https://planetpython.org/", "urlaspattern": false, "tree": 1, "hidden": false, @@ -2139,7 +2163,7 @@ "access_restricted": false, "access_perm_type": 1, "parent": 12, - "sort_order": 97, + "sort_order": 98, "access_permissions": [] } }, @@ -2149,7 +2173,7 @@ "fields": { "title": "PyCon News", "hint": "PyCon Blog", - "url": "http://pycon.blogspot.com/", + "url": "https://pycon.blogspot.com/", "urlaspattern": false, "tree": 1, "hidden": false, @@ -2163,7 +2187,7 @@ "access_restricted": false, "access_perm_type": 1, "parent": 12, - "sort_order": 99, + "sort_order": 100, "access_permissions": [] } }, @@ -2389,7 +2413,7 @@ "fields": { "title": "Self-certify as voting member", "hint": "", - "url": "http://pyfound.blogspot.de/2015/02/enroll-as-psf-voting-member.html", + "url": "https://pyfound.blogspot.com/2015/02/enroll-as-psf-voting-member.html", "urlaspattern": false, "tree": 1, "hidden": false, @@ -2509,7 +2533,7 @@ "fields": { "title": "Python Brochure", "hint": "", - "url": "http://brochure.getpython.info/", + "url": "https://brochure.getpython.info/", "urlaspattern": false, "tree": 1, "hidden": false, diff --git a/templates/components/blog-posts.html b/templates/components/blog-posts.html index 6cdd3bc66..6b34cb33f 100644 --- a/templates/components/blog-posts.html +++ b/templates/components/blog-posts.html @@ -2,7 +2,7 @@

Latest News

-

More

+

More