Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds the final transitional blog post ("The Python Insider Blog Has Moved!") that announces the migration from Blogger to the new Git-backed Astro site. It includes the post content, the author profile for Jacob Coffee, a new redirect entry, and four new showcase Astro components used inline in the post to demonstrate the new site's features.
Changes:
- Adds a new blog post (
index.mdx) announcing the migration with embedded live showcase components illustrating blog features (post cards, tag cloud, author list, command palette mockup). - Adds four new showcase UI components (
ShowcasePostCards.astro,ShowcaseTagCloud.astro,ShowcaseAuthors.astro,ShowcaseSearch.astro) used exclusively within the new post. - Adds the
jacob-coffee.jsonauthor file and a new entry inredirects.jsonfor the new post's legacy URL.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
content/posts/the-python-insider-blog-has-moved/index.mdx |
New blog post announcing the migration, embedding the showcase components |
content/authors/jacob-coffee.json |
New author entry for Jacob Coffee (contains a spelling typo in bio) |
src/data/redirects.json |
Adds legacy redirect for the new post |
src/components/showcase/ShowcaseTagCloud.astro |
New component showing top tags by frequency |
src/components/showcase/ShowcaseSearch.astro |
New static mockup of the command palette |
src/components/showcase/ShowcasePostCards.astro |
New component showing recent posts with mini sidebar (contains unused import and repeated filter) |
src/components/showcase/ShowcaseAuthors.astro |
New component showing top authors by post count |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -0,0 +1,11 @@ | |||
| { | |||
| "name": "Jacob Coffee", | |||
| "bio": "Python Software Foundation Staff. Litestar Maintainer.", | |||
There was a problem hiding this comment.
The bio field contains a typo: "Infradwre" should be "Infrastructure".
| @@ -0,0 +1,100 @@ | |||
| --- | |||
| import { getCollection } from "astro:content"; | |||
| import { formatDate, postUrl, slugify, withBase } from "../../lib/utils"; | |||
There was a problem hiding this comment.
slugify is imported from ../../lib/utils but is never used anywhere in this file. The only usage in the template refers to postUrl, formatDate, and withBase. Removing the unused import keeps the file clean.
| import { formatDate, postUrl, slugify, withBase } from "../../lib/utils"; | |
| import { formatDate, postUrl, withBase } from "../../lib/utils"; |
| const recentPosts = allPosts | ||
| .filter((p) => p.data.published) | ||
| .sort((a, b) => b.data.publishDate.getTime() - a.data.publishDate.getTime()) | ||
| .slice(0, 3); | ||
|
|
||
| // Collect years from all posts for the mini sidebar | ||
| const yearSet = new Set<number>(); | ||
| for (const post of allPosts.filter((p) => p.data.published)) { | ||
| yearSet.add(post.data.publishDate.getFullYear()); | ||
| } | ||
| const years = [...yearSet].sort((a, b) => b - a).slice(0, 8); | ||
|
|
||
| // Top tags for the mini sidebar | ||
| const tagCounts = new Map<string, number>(); | ||
| for (const post of allPosts.filter((p) => p.data.published)) { | ||
| for (const tag of post.data.tags) { | ||
| tagCounts.set(tag, (tagCounts.get(tag) || 0) + 1); | ||
| } | ||
| } | ||
| const topTags = [...tagCounts.entries()].sort((a, b) => b[1] - a[1]).slice(0, 10); | ||
| --- | ||
|
|
||
| <div class="not-prose my-8 overflow-hidden rounded-xl border border-zinc-200 dark:border-zinc-800"> | ||
| <div class="flex items-center justify-between border-b border-zinc-200 bg-zinc-50 px-5 py-3 dark:border-zinc-800 dark:bg-zinc-900/50"> | ||
| <div class="flex items-center gap-2"> | ||
| <svg class="h-4 w-4 text-zinc-400" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"> | ||
| <path d="M2 3h6a4 4 0 014 4v14a3 3 0 00-3-3H2z" stroke-linecap="round" stroke-linejoin="round" /> | ||
| <path d="M22 3h-6a4 4 0 00-4 4v14a3 3 0 013-3h7z" stroke-linecap="round" stroke-linejoin="round" /> | ||
| </svg> | ||
| <span class="text-sm font-semibold text-zinc-700 dark:text-zinc-300" style="font-family: var(--font-display);">Blog</span> | ||
| <span class="text-xs text-zinc-400 dark:text-zinc-500">{allPosts.filter((p) => p.data.published).length} posts with filters & pagination</span> |
There was a problem hiding this comment.
The filter allPosts.filter((p) => p.data.published) is applied four times — on lines 7, 13, 20, and 36. With 300+ posts in the collection, this means iterating the full array four times unnecessarily. Consider extracting this into a publishedPosts variable (as is done in the sibling components ShowcaseTagCloud.astro and ShowcaseAuthors.astro) and reusing it throughout.
Imports the final Blogger post, and adds some fancies to showcase what the new blog can do.
Adds author file