From 9831262cb911ed49034d90720613b31a77657f1f Mon Sep 17 00:00:00 2001 From: Nicholai Date: Thu, 18 Dec 2025 14:22:35 -0700 Subject: [PATCH] Refactor README files: simplify headings, update commands, trim verbose - Updated top-level headings in README.md and src/utils/README.md - Replaced tech stack section with concise list - Updated dev command examples to use `pnpm run deploy` - Revised blog section wording - Removed detailed workflow, features, and troubleshooting sections from utils README - Adjusted ffmpeg installation notes for Linux --- README.md | 37 +++++--------------------------- src/utils/README.md | 51 +-------------------------------------------- 2 files changed, 6 insertions(+), 82 deletions(-) diff --git a/README.md b/README.md index a6222f3..8ba8792 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Personal portfolio and blog site built with Astro. 🌐 [Live Site](https://nicholai.work) -## Tech Stack +## I used these: - **Astro** - Static site framework - **React** - Interactive components @@ -13,61 +13,34 @@ Personal portfolio and blog site built with Astro. - **Cloudflare Pages** - Hosting & deployment - **TypeScript** - Type safety -## Development +## some commands ```bash -# Install dependencies pnpm install -# Start dev server pnpm dev -# Build for production pnpm build -# Preview production build pnpm preview -# Deploy to Cloudflare Pages -pnpm deploy +pnpm run deploy ``` ## Image Optimization -The project includes a utility script to convert images to AVIF format for optimal web performance. - -### Converting Images to AVIF - -AVIF images are typically 80-98% smaller than JPEGs/PNGs while maintaining excellent quality, making them ideal for web use. - ```bash # Convert all images in src/assets/ pnpm run convert:avif:all -# Convert only JPEG images pnpm run convert:avif:jpeg -# Convert only PNG images pnpm run convert:avif:png # Custom quality (0-100, default: 65) node src/utils/convert-to-avif.js --jpeg --quality 80 ``` - -**Features:** -- Preserves original images -- Skips already-converted files -- Shows file size savings -- Supports JPEG, PNG, WebP, GIF, BMP, and TIFF - -**Requirements:** -- ffmpeg must be installed: - - Linux: `sudo apt install ffmpeg` - - macOS: `brew install ffmpeg` - -See `src/utils/README.md` for detailed documentation. - -## Creating Blog Posts +## Blog Blog posts are created as MDX files in the `src/content/blog/` directory. The file name becomes the URL slug (e.g., `my-post.mdx` → `/blog/my-post/`). @@ -244,6 +217,6 @@ src/ ## Deployment -The site is deployed to Cloudflare Pages. The `pnpm deploy` command builds the site and deploys it using Wrangler. +The site is deployed to Cloudflare Pages. The `pnpm run deploy` command builds the site and deploys it using Wrangler. Deployment happens automatically on push to the main branch (if configured in Cloudflare Pages dashboard). diff --git a/src/utils/README.md b/src/utils/README.md index bd1b551..abc24c5 100644 --- a/src/utils/README.md +++ b/src/utils/README.md @@ -34,60 +34,11 @@ pnpm commit # 4. Choose to [A]ccept, [E]dit, or [C]ancel # 5. Optionally push to remote ``` - -**Workflow:** -1. **Staged Files Check** - Verifies you have changes staged -2. **Context Gathering** - Collects git diff and status -3. **AI Generation** - Calls OpenRouter API (inception/mercury-coder model) to generate commit message -4. **Review & Edit** - Shows message and prompts for approval -5. **Commit** - Creates the commit with approved message -6. **Optional Push** - Asks if you want to push to remote - -**Features:** -- AI-powered commit message generation -- Interactive approval process -- Message editing capability -- Optional automatic push -- Follows project commit message conventions -- Detailed error messages and help text - -**Example session:** -``` -🚀 Git Commit Automation - -🔍 Gathering git context... -🤖 Generating commit message with OpenRouter... - -📝 Generated commit message: -──────────────────────────────────────────────────────────── -Add git commit automation script with OpenRouter integration - -- Create interactive commit message generator using inception/mercury-coder -- Support message editing and approval workflow -- Add optional push to remote after commit -──────────────────────────────────────────────────────────── - -[A]ccept / [E]dit / [C]ancel? a - -📦 Creating commit... -✅ Commit created successfully! - -Push to remote? [y/N] y -🚀 Pushing to remote... -✅ Pushed successfully! - -✨ Done! -``` - **Options:** - `--help`, `-h` - Show help message **Troubleshooting:** - If you get ".env file not found" error, create `src/utils/.env` with your OpenRouter API key -- Get your API key from: https://openrouter.ai/keys -- If you get "401 Unauthorized", check that your API key is correct in the `.env` file -- The script requires staged changes - use `git add` first -- Make sure `.env` is git-ignored (already configured in `.gitignore`) ## Image Conversion Script @@ -97,7 +48,7 @@ Converts images in the `assets/` directory to AVIF format using ffmpeg. Original **Prerequisites:** - ffmpeg must be installed on your system - - Linux: `sudo apt install ffmpeg` + - Linux: `sudo apt install ffmpeg` `sudo pacman -S ffmpeg` - macOS: `brew install ffmpeg` - Windows: Download from [ffmpeg.org](https://ffmpeg.org/download.html)