kampuscadilari/CLAUDE.md
2025-12-27 19:36:09 +00:00

2.2 KiB

CLAUDE.md

Development guidance for this minimal Astro template repository.

Commands

Core Development

pnpm dev              # Development server
pnpm build            # Build for production
pnpm preview          # Preview build with Wrangler
pnpm deploy           # Deploy to Cloudflare Pages

Utilities

pnpm commit           # AI-powered commit messages
pnpm convert:avif:all # Convert all images to AVIF
pnpm convert:avif:jpeg
pnpm convert:avif:png
pnpm cf-typegen       # Generate Cloudflare types

Change Documentation

IMPORTANT: Update dev/continuity.md when making changes to document:

  • What changed and why
  • Decisions made
  • Next steps

Architecture

Minimal Astro template with barebones structure:

Content Layer (src/content/)

  • blog/ - MDX blog posts with schema validation (title, description, pubDate, updatedDate, heroImage, category, tags)

Schema defined in src/content.config.ts

Component Layer

Minimal components only:

  • BaseHead.astro - Basic SEO metadata
  • BlogCard.astro - Simple blog post card
  • FormattedDate.astro - Date formatting utility

Routes

  • / - Homepage with links to blog and contact
  • /blog - Blog index listing all posts
  • /blog/[slug] - Individual blog post pages
  • /contact - Basic contact form
  • /404 - 404 error page

Layouts

  • BaseLayout.astro - Basic HTML structure with head
  • BlogPost.astro - Blog post layout with metadata

Styling

Minimal global CSS in src/styles/global.css:

  • Basic typography
  • Simple prose styles for markdown content
  • No elaborate themes, animations, or custom styling

Image Handling

  • src/assets/ - Processed by Astro (use for heroImage in frontmatter)
  • public/media/ - Served as-is (use absolute paths like /media/file.mp4)
  • AVIF conversion utility available

Deployment

  • Cloudflare Pages adapter configured
  • Image service: "compile" mode
  • Platform proxy enabled for development

Utility Scripts

  • src/utils/convert-to-avif.js - Image optimization
  • src/utils/git-commit.js - AI commit message generation (requires OpenRouter API key in src/utils/.env)
  • src/utils/reading-time.ts - Calculate reading time for blog posts