Skip to content
Open
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
20 changes: 19 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,24 @@ concurrency:
cancel-in-progress: true

jobs:
pre-commit:
name: Pre-commit hooks
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Install dependencies
run: bun install --frozen-lockfile

- name: Run pre-commit hooks via prek
uses: j178/prek-action@v1

quality:
name: Quality checks
runs-on: ubuntu-latest
Expand Down Expand Up @@ -45,7 +63,7 @@ jobs:
build:
name: Build
runs-on: ubuntu-latest
needs: [quality, spellcheck]
needs: [pre-commit, quality, spellcheck]
steps:
- name: Checkout
uses: actions/checkout@v6
Expand Down
33 changes: 26 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,44 @@ help: ## Show this help message
}' $(MAKEFILE_LIST)
@echo ""

.PHONY: check-deps
check-deps: ## Verify required tools are installed
@command -v bun >/dev/null 2>&1 || { \
echo ""; \
echo " bun is required but not installed."; \
echo ""; \
echo " Install:"; \
echo " macOS: brew install oven-sh/bun/bun"; \
echo " Linux/WSL: curl -fsSL https://bun.sh/install | bash"; \
echo ""; \
echo " See: https://bun.sh/docs/installation"; \
echo ""; \
exit 1; \
}

.PHONY: install
install: ## Install dependencies and git hooks
install: check-deps ## Install dependencies and git hooks
bun install
prek install
@if command -v prek >/dev/null 2>&1; then \
prek install; \
else \
echo "prek not found — skipping git hook setup (optional, see README)"; \
fi

## Development

.PHONY: dev
dev: ## Start development server
dev: check-deps ## Start development server
bun run dev

.PHONY: preview
preview: ## Build and preview production locally
preview: check-deps ## Build and preview production locally
bun run preview

## Build

.PHONY: build
build: ## Build production bundle
build: check-deps ## Build production bundle
bun run build

.PHONY: clean
Expand All @@ -45,11 +64,11 @@ clean: ## Clean build artifacts and caches
## Quality

.PHONY: lint
lint: ## Run oxlint on source files
lint: check-deps ## Run oxlint on source files
bunx oxlint src/

.PHONY: typecheck
typecheck: ## Run TypeScript type checking
typecheck: check-deps ## Run TypeScript type checking
bunx astro check

.PHONY: check
Expand Down
157 changes: 126 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,51 +1,146 @@
## Python Insider Blog

Blog for Python core team, mostly for blogging about releases.
The official blog for the Python core teammostly release announcements.
Copy link
Member

Choose a reason for hiding this comment

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

But we want other stuff too :)

Suggested change
The official blog for the Python core team — mostly release announcements.
The official blog for the Python core team.


## About
Built with [Astro](https://astro.build/) and [Keystatic](https://keystatic.com/) CMS.
Content is plain Markdown, built statically at deploy time.

Uses keystatic for WYSIWYG editing.
## Quickstart

Features some custom components like:
### Prerequisites

- GitHub User, Repo
- PyPI Project
- CPython Docs
**Bun** — the JavaScript runtime used for this project.

Utilizes Bun for builds. Uses Astro.js which builds statically at build time.
Pre-commit config, powered by Prek to do CI things and spellchecks.
```bash
# macOS
brew install oven-sh/bun/bun

### From Blogger
# Linux / WSL
curl -fsSL https://bun.sh/install | bash

Migrated from Blogger with a field on new posts of "Previous Blogger URL"
so that we can more easily redirect.
# Windows — use WSL, then the Linux command above
```

### Posts
See [bun.sh/docs/installation](https://bun.sh/docs/installation) for other methods.

Posts are structured under `content/posts/`.
They have the directory named after the blog entry title.
**prek** (optional) — runs pre-commit hooks locally. Only needed if you want
to run linting/spellcheck before pushing. CI will catch these regardless.

Inside is the core markdown (index.md) and optionally the images
used in the blog entry.
```bash
# macOS
brew install prefix-dev/prek/prek

### Authors
# Linux / Windows (standalone installer)
curl -fsSL https://prek.j178.dev/install.sh | bash

# Or via cargo / pip / other methods
cargo install prek
Comment on lines +30 to +37
Copy link
Member

Choose a reason for hiding this comment

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

All of these are wrong!

https://prek.j178.dev/installation/

Maybe we should just point to the install page and let people choose their preferred method? I expect many will prefer pip, uv or Homebrew.

```

See [prek.j178.dev/installation](https://prek.j178.dev/installation/#standalone-installer)
for all installation options.

> [!NOTE]
> **Windows users**: The Makefile requires a Unix shell. Use
> [WSL](https://learn.microsoft.com/en-us/windows/wsl/install) or Git Bash.
> Alternatively, skip `make` and run the bun commands directly (see table below).

### Setup

```bash
git clone https://github.com/python/python-insider-blog.git
cd python-insider-blog
make install # installs node_modules + git hooks
make dev # starts dev server at http://127.0.0.1:4321
```

`make install` runs `bun install` (dependencies) and `prek install` (git hooks).
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
`make install` runs `bun install` (dependencies) and `prek install` (git hooks).
`make install` runs `bun install` (dependencies) and `prek install` (Git hooks).

If you don't have prek installed, the hook setup will fail but everything else
still works — you can write and preview posts without it.

Authors are configured via `content/authors/`.
## Writing a blog post

## Contributing
### Option A: Use the Keystatic UI (recommended)

There are `Make` targets to get up and going, assuming you have the
tooling required (Bun, prek, etc.)
1. Run `make dev`
2. Open http://127.0.0.1:4321/keystatic in your browser
3. Create or edit a post with the visual editor
4. Commit and open a pull request

### Writing Blog Entries
### Option B: Write Markdown directly

You can pull the repo, run `make dev`, and edit the page via Keystatic
with the nice UI or you can write markdown in your editor.
Create a new directory under `content/posts/` named after your post slug,
with an `index.md` inside:

Both should open a pull request to GitHub for review and CI checks.
```
content/posts/python-31213-31115-31020/
└── index.md
```

Frontmatter fields:

```yaml
---
title: "Python 3.12.13, 3.11.15, and 3.10.20 are now available"
description: "Security fix release for Python 3.12, 3.11, and 3.10"
authors:
- thomas-wouters
tags:
- "3.12"
- "3.11"
- "3.10"
pubDate: 2026-03-03
draft: false
previousBloggerUrl: ""
---
```

Then write the body in standard Markdown. Open a PR when done.

> [!TIP]
> Links to PEPs, CPython docs, PyPI, GitHub repos/issues, CVEs, and
> python.org releases are automatically styled as inline reference badges.
> Just use normal Markdown links — no special syntax needed.
>
> If you're using the Keystatic editor, you also have access to explicit
> inline components: `{% GhUser name="hugovk" /%}`, `{% Pep number=649 /%}`, etc.

### Authors

> [!NOTE]
> You have access to a few custom components that can be used like
> `{% GhUser name="hugovk" /%}`, but PEPs, CPython docs, and GitHub links
> will automatically be picked up if you use standard markdown via the
> URL regex.
Author profiles live in `content/authors/{id}.json`. If you're writing your
first post, create one (or use the Make target):

```bash
make content-new-author ID=your-name NAME="Your Name"
```

Then edit the JSON to add your GitHub handle, avatar URL, etc.

## Development

| Make target | Without make | What it does |
| ------------------ | ------------------------ | ------------------------------------ |
| `make install` | `bun install` | Install dependencies (+ git hooks) |
| `make dev` | `bun run dev` | Start Astro dev server |
| `make build` | `bun run build` | Production build |
| `make preview` | `bun run preview` | Build and preview production locally |
| `make check` | `bun run lint && bun run typecheck` | Run linter + type checker |
| `make spellcheck` | — | Run typos spell checker (needs prek) |
| `make clean` | — | Remove build artifacts and caches |
| `make fresh` | — | Full clean reinstall |

Run `make help` for the complete list.

## Project structure

```
content/
authors/ # Author profiles (JSON)
posts/ # Blog posts (Markdown + images)
src/
components/ # Astro/React components
layouts/ # Page layouts
pages/ # Astro routes
plugins/ # Remark plugins (reference badges, etc.)
assets/ # Styles, fonts
```
Loading