Skip to content

Commit a3fe1ab

Browse files
committed
initial blog migration
0 parents  commit a3fe1ab

File tree

432 files changed

+19708
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

432 files changed

+19708
-0
lines changed

.github/dependabot.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: npm
4+
directory: /
5+
schedule:
6+
interval: weekly
7+
day: monday
8+
open-pull-requests-limit: 10
9+
groups:
10+
astro:
11+
patterns:
12+
- "astro"
13+
- "@astrojs/*"
14+
react:
15+
patterns:
16+
- "react"
17+
- "react-dom"
18+
- "@types/react*"
19+
keystatic:
20+
patterns:
21+
- "@keystatic/*"
22+
tailwind:
23+
patterns:
24+
- "tailwindcss"
25+
- "@tailwindcss/*"
26+
- "postcss"
27+
28+
- package-ecosystem: github-actions
29+
directory: /
30+
schedule:
31+
interval: weekly
32+
day: monday
33+
open-pull-requests-limit: 5

.github/workflows/ci.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
push:
7+
branches: [main]
8+
9+
concurrency:
10+
group: ci-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
quality:
15+
name: Quality checks
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
21+
- name: Setup Bun
22+
uses: oven-sh/setup-bun@v2
23+
with:
24+
bun-version: latest
25+
26+
- name: Install dependencies
27+
run: bun install --frozen-lockfile
28+
29+
- name: Lint
30+
run: bunx oxlint src/
31+
32+
- name: Type check
33+
run: bunx astro check
34+
35+
spellcheck:
36+
name: Spell check
37+
runs-on: ubuntu-latest
38+
steps:
39+
- name: Checkout
40+
uses: actions/checkout@v4
41+
42+
- name: Spell check
43+
uses: crate-ci/typos@v1.32.0
44+
45+
build:
46+
name: Build
47+
runs-on: ubuntu-latest
48+
needs: [quality, spellcheck]
49+
steps:
50+
- name: Checkout
51+
uses: actions/checkout@v4
52+
53+
- name: Setup Bun
54+
uses: oven-sh/setup-bun@v2
55+
with:
56+
bun-version: latest
57+
58+
- name: Install dependencies
59+
run: bun install --frozen-lockfile
60+
61+
- name: Build
62+
run: bun run build

.github/workflows/deploy.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: pages
15+
cancel-in-progress: false
16+
17+
jobs:
18+
build:
19+
name: Build
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
25+
- name: Setup Bun
26+
uses: oven-sh/setup-bun@v2
27+
with:
28+
bun-version: latest
29+
30+
- name: Setup Pages
31+
uses: actions/configure-pages@v5
32+
33+
- name: Install dependencies
34+
run: bun install --frozen-lockfile
35+
36+
- name: Lint
37+
run: bunx oxlint src/
38+
39+
- name: Type check
40+
run: bunx astro check
41+
42+
- name: Spell check
43+
uses: crate-ci/typos@v1.32.0
44+
45+
- name: Build
46+
run: bun run build
47+
48+
- name: Upload artifact
49+
uses: actions/upload-pages-artifact@v3
50+
with:
51+
path: ./dist
52+
53+
deploy:
54+
name: Deploy
55+
runs-on: ubuntu-latest
56+
needs: build
57+
environment:
58+
name: github-pages
59+
url: ${{ steps.deployment.outputs.page_url }}
60+
steps:
61+
- name: Deploy to GitHub Pages
62+
id: deployment
63+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# build output
2+
dist/
3+
# generated types
4+
.astro/
5+
6+
# dependencies
7+
node_modules/
8+
9+
# logs
10+
npm-debug.log*
11+
yarn-debug.log*
12+
yarn-error.log*
13+
pnpm-debug.log*
14+

.pre-commit-config.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v5.0.0
4+
hooks:
5+
- id: trailing-whitespace
6+
args: [--markdown-linebreak-ext=md]
7+
- id: end-of-file-fixer
8+
- id: check-yaml
9+
- id: check-json
10+
- id: check-merge-conflict
11+
- id: check-added-large-files
12+
args: [--maxkb=200]
13+
14+
- repo: https://github.com/crate-ci/typos
15+
rev: v1.32.0
16+
hooks:
17+
- id: typos
18+
19+
- repo: local
20+
hooks:
21+
- id: lint
22+
name: lint
23+
entry: bun run lint
24+
language: system
25+
pass_filenames: false
26+
27+
- id: typecheck
28+
name: typecheck
29+
entry: bun run typecheck
30+
language: system
31+
pass_filenames: false

Makefile

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
.DEFAULT_GOAL := help
2+
SHELL := /bin/bash
3+
4+
## General
5+
6+
.PHONY: help
7+
help: ## Show this help message
8+
@echo ""
9+
@echo "Usage:"
10+
@echo " make <target>"
11+
@echo ""
12+
@awk 'BEGIN {FS = ":.*?## "; section=""} \
13+
/^## / { section=substr($$0, 4); next } \
14+
/^[a-zA-Z_-]+:.*?## / { \
15+
if (section != prev) { printf "\n\033[1m%s\033[0m\n", section; prev=section } \
16+
printf " \033[36m%-20s\033[0m %s\n", $$1, $$2 \
17+
}' $(MAKEFILE_LIST)
18+
@echo ""
19+
20+
.PHONY: install
21+
install: ## Install dependencies and git hooks
22+
bun install
23+
prek install
24+
25+
## Development
26+
27+
.PHONY: dev
28+
dev: ## Start development server
29+
bun run dev
30+
31+
.PHONY: preview
32+
preview: ## Build and preview production locally
33+
bun run preview
34+
35+
## Build
36+
37+
.PHONY: build
38+
build: ## Build production bundle
39+
bun run build
40+
41+
.PHONY: clean
42+
clean: ## Clean build artifacts and caches
43+
rm -rf dist .astro node_modules/.astro
44+
45+
## Quality
46+
47+
.PHONY: lint
48+
lint: ## Run oxlint on source files
49+
bunx oxlint src/
50+
51+
.PHONY: typecheck
52+
typecheck: ## Run TypeScript type checking
53+
bunx astro check
54+
55+
.PHONY: check
56+
check: lint typecheck ## Run all checks (typecheck + lint)
57+
58+
.PHONY: spellcheck
59+
spellcheck: ## Run spell checker on all files
60+
prek run typos --all-files
61+
62+
.PHONY: pre-commit
63+
pre-commit: ## Run all pre-commit hooks
64+
prek run --all-files
65+
66+
## Content
67+
68+
.PHONY: migrate
69+
migrate: ## Migrate Blogger posts
70+
bun run scripts/migrate-blogger.ts
71+
72+
.PHONY: content-new-author
73+
content-new-author: ## Create a new author (ID=author-id NAME="Author Name")
74+
@if [ -z "$(ID)" ] || [ -z "$(NAME)" ]; then \
75+
echo "Usage: make content-new-author ID=author-id NAME=\"Author Name\""; exit 1; fi
76+
@echo '{"name":"$(NAME)","bio":"","github":"","avatar":"","twitter":"","bluesky":"","mastodon":"","website":"","featured":false}' \
77+
| python3 -m json.tool > content/authors/$(ID).json
78+
@echo "Created content/authors/$(ID).json"
79+
80+
## Maintenance
81+
82+
.PHONY: fresh
83+
fresh: clean ## Clean install (remove node_modules and reinstall)
84+
rm -rf node_modules bun.lock
85+
bun install
86+
87+
.PHONY: update
88+
update: ## Update all dependencies
89+
bun update

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
## Python Insider Blog
2+
3+
Blog for Python core team, mostly for blogging about releases.
4+
5+
### About
6+
7+
Uses keystatic for WYSIWYG editing.
8+
9+
Features some custom components like:
10+
11+
- GitHub User, Repo
12+
- PyPI Project
13+
- CPython Docs
14+
15+
Utilizes Bun for builds. Uses Astro.js which builds statically at build time.
16+
Pre-commit config, powered by Prek to do CI things and spellchecks.
17+
18+
### From Blogger
19+
20+
Migrated from Blogger with a field on new posts of "Previous Blogger URL"
21+
so that we can more easily redirect.
22+
23+
### Posts
24+
25+
Posts are structred under `content/posts/`.
26+
They have the directory named after the blog entry title.
27+
28+
Inside is the core markdown (index.md) and optionally the images
29+
used in the blog entry.
30+
31+
### Authors
32+
33+
Authors are configured via `content/authors/`.

_typos.toml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
[files]
2+
extend-exclude = [
3+
"bun.lock",
4+
"node_modules/",
5+
"dist/",
6+
".astro/",
7+
"*.min.js",
8+
]
9+
10+
[default]
11+
extend-ignore-re = [
12+
# Markdown frontmatter dates
13+
"publishDate:.*",
14+
"updatedDate:.*",
15+
# URLs
16+
"https?://[^\\s)\"'>]+",
17+
# HTML entities
18+
"&[a-z]+;",
19+
]
20+
21+
[default.extend-words]
22+
# Author names
23+
Wouters = "Wouters"
24+
Brandl = "Brandl"
25+
Hamel = "Hamel"
26+
Deily = "Deily"
27+
Durbin = "Durbin"
28+
Hastings = "Hastings"
29+
Kuchling = "Kuchling"
30+
Galindo = "Galindo"
31+
Driscoll = "Driscoll"
32+
Jenvey = "Jenvey"
33+
Langa = "Langa"
34+
haypo = "haypo"
35+
# Python/tech terms
36+
pyc = "pyc"
37+
pyo = "pyo"
38+
repr = "repr"
39+
compat = "compat"
40+
noreply = "noreply"
41+
# Common in migrated Blogger content
42+
ba = "ba"
43+
iff = "iff"
44+
nd = "nd"
45+
ons = "ons"
46+
te = "te"

0 commit comments

Comments
 (0)