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
4 changes: 2 additions & 2 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ runs:
using: composite
steps:
- name: Setup pnpm
uses: pnpm/action-setup@v4
uses: pnpm/action-setup@v6

- name: Setup Node
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version: "22"
cache: "pnpm"
Expand Down
27 changes: 3 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Setup
uses: ./.github/actions/setup
Expand All @@ -23,49 +23,28 @@ jobs:
- name: Build
run: pnpm build

- name: Upload Build Artifacts
uses: actions/upload-artifact@v4
with:
name: build-output
path: |
.svelte-kit
node_modules
retention-days: 1

lint:
needs: build
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Setup
uses: ./.github/actions/setup

- name: Download Build Artifacts
uses: actions/download-artifact@v4
with:
name: build-output

- name: Run Lint
run: pnpm lint

check:
needs: build
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Setup
uses: ./.github/actions/setup

- name: Download Build Artifacts
uses: actions/download-artifact@v4
with:
name: build-output

- name: Run Type Check
run: pnpm check
8 changes: 6 additions & 2 deletions .github/workflows/wrangler-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
ref: ${{ inputs.ref || github.ref }}

Expand All @@ -42,7 +42,11 @@ jobs:
SITE_URL: ${{ inputs.site_url }}

- name: Deploy to Cloudflare
run: pnpm wrangler deploy --env ${{ inputs.environment }}
run: >-
pnpm wrangler deploy
--env ${{ inputs.environment }}
--var ENVIRONMENT:${{ inputs.environment }}
--var SITE_URL:${{ inputs.site_url }}
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.cloudflare_api_token }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.cloudflare_account_id }}
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
.DS_Store
node_modules

.idea/
.vscode/

.svelte-kit
.astro
.wrangler
build
dist

.env
.env.*
Expand Down
21 changes: 21 additions & 0 deletions .wip/tasks/draft-markdown-callouts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
status: draft
---

# Render Markdown in info callouts

## Problem

Info callouts are currently written as raw `<doc-info>` HTML blocks inside Markdown posts. Markdown syntax inside raw HTML is not parsed, so inline code like backticks renders literally in the HTML. This makes callout content inconsistent with the surrounding prose and forces authors to use manual HTML for normal Markdown formatting.

## Proposed solution

Authors should be able to write info callouts with normal Markdown content, including inline code, links, emphasis, and other common inline formatting. Existing callout styling and rendered markup should remain visually consistent with the current `<doc-info>` presentation.

The preferred authoring format is MDX for posts that need Markdown-rendered callout contents. Existing plain Markdown posts should continue to work.

## Requirements

- Existing published posts that use `<doc-info>` should continue to render as callouts or be migrated to the new supported Markdown-friendly syntax.
- Inline Markdown inside info callouts must render correctly.
- The solution should preserve the existing callout appearance.
1 change: 0 additions & 1 deletion AGENTS.md

This file was deleted.

133 changes: 133 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
# johnhooks.io

Personal website built with Astro, deployed to Cloudflare Workers.

## Conversational Style

- Keep answers short and concise.
- No fluff or cheerful filler.
- Technical prose only, be kind but direct.
- No emojis in commits, issues, PR comments, or code.
- Prefer clear recommendations over long option lists.

## Code Quality

- Read files before making broad changes.
- Match existing style unless the task is intentionally changing the stack or conventions.
- Use specific TypeScript types; avoid `any` unless there is no practical alternative.
- Check installed package types/docs instead of guessing external APIs.
- Do not remove intentional functionality without calling it out.
- Do not commit unless explicitly asked.

## Tech Stack

- **Framework**: Astro
- **Styling**: Authored CSS with custom properties and intrinsic design tokens
- **Content**: Markdown pages rendered by Astro
- **Syntax Highlighting**: Astro's Shiki integration with `@shikijs/transformers`
- **Deployment**: Cloudflare Workers via Wrangler
- **Package Manager**: pnpm

## Project Structure

```txt
src/
├── components/ # Astro components
├── layouts/ # Shared page layouts
├── lib/astro/ # Astro-specific content and site helpers
├── pages/ # Astro routes, including dynamic post/project routes
├── posts/ # Markdown blog posts
└── projects/ # Markdown project pages

static/ # Static assets: images, favicon
docs/plans/ # Implementation plans for future work
```

## Environment Configuration

### Build-time

- `SITE_URL` - Site origin used for canonical URLs and social cards.
- Falls back to `http://localhost:4321` in development.

### Runtime: Cloudflare Workers

- `ENVIRONMENT` - `production` or `staging`.
- `SITE_URL` - Site URL for the deployed environment.

Runtime values are defined in `wrangler.jsonc` under `env.production` and `env.staging`.

## Commands

```bash
pnpm dev # Start Astro dev server
pnpm build # Build for production
pnpm preview # Preview production build
pnpm deploy # Build and deploy to production
pnpm deploy:staging # Build and deploy to staging
pnpm lint # Run Prettier check + ESLint
pnpm check # Run astro check
pnpm format # Format with Prettier
```

After code changes, run:

```bash
pnpm lint
pnpm check
pnpm build
```

Documentation-only changes do not require the full build unless they affect rendered content or examples.

## Deployment

### Local Deploy

```bash
SITE_URL=https://johnhooks.io pnpm deploy
SITE_URL=https://website-staging.johnhooks.workers.dev pnpm deploy:staging
```

### CI Deploy

GitHub Actions workflows in `.github/workflows/`:

- `deploy-production.yml` - Manual production deploy.
- `deploy-staging.yml` - Manual staging deploy.
- `wrangler-deploy.yml` - Shared deploy workflow.

Required GitHub secrets:

- `CLOUDFLARE_API_TOKEN`
- `CLOUDFLARE_ACCOUNT_ID`

## URLs

- **Production**: https://johnhooks.io and https://www.johnhooks.io
- **Staging**: https://website-staging.johnhooks.workers.dev
- **Workers.dev**: https://website.johnhooks.workers.dev

## Rendering Model

Most pages are prerendered at build time with:

```ts
export const prerender = true;
```

Dynamic routes:

- `/robots.txt` - Returns different content based on `ENVIRONMENT`.

## Content Notes

- Posts live in `src/posts/*.md`.
- Projects live in `src/projects/*.md`.
- Published entries require `isPublished: true` in frontmatter.
- Homepage ordering is by `publishedOn`, newest first.
- Some older Markdown files use a custom `<doc-info>` callout element styled in `src/app.css`.

## Future Work

- See `docs/plans/sitemap.md` for sitemap implementation notes.
88 changes: 0 additions & 88 deletions CLAUDE.md

This file was deleted.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[johnhooks.io](https://johnhooks.io)

Personal website built with [SvelteKit](https://kit.svelte.dev) and deployed to Cloudflare Workers.
Personal website built with [Astro](https://astro.build) and deployed to Cloudflare Workers.

## Developing

Expand All @@ -24,9 +24,9 @@ pnpm preview
pnpm deploy
```

Or test locally with wrangler:
Or test locally with Wrangler after building:

```bash
pnpm build
wrangler dev .svelte-kit/cloudflare
pnpm wrangler dev --env staging
```
Loading