Skip to content

Commit bbed65e

Browse files
committed
chore: claude stuff and timezone fixes
1 parent e49ecb8 commit bbed65e

File tree

5 files changed

+133
-32
lines changed

5 files changed

+133
-32
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,5 @@ pnpm-debug.log*
2424
.idea/
2525

2626
.claude/
27+
28+
CLAUDE.local.md

CLAUDE.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Critical Rules
6+
7+
**These rules override all other instructions:**
8+
9+
1. **NEVER commit directly to main** - Always create a feature branch and submit a pull request
10+
2. **Conventional commits** - Format: `type(scope): description`
11+
3. **GitHub Issues for TODOs** - Use `gh` CLI to manage issues, no local TODO files. Use conventional commit format for issue titles
12+
4. **Pull Request titles** - Use conventional commit format (same as commits)
13+
5. **Branch naming** - Use format: `type/scope/short-description` (e.g., `feat/blog/new-post-script`)
14+
6. **Working an issue** - Always create a new branch from an updated main branch
15+
7. **Check branch status before pushing** - Verify the remote tracking branch still exists. If a PR was merged/deleted, create a new branch from main instead
16+
17+
### Conventional Commit Types
18+
19+
| Type | Description |
20+
|------|-------------|
21+
| `feat` | New feature |
22+
| `fix` | Bug fix |
23+
| `docs` | Documentation only |
24+
| `refactor` | Code change that neither fixes a bug nor adds a feature |
25+
| `test` | Adding or updating tests |
26+
| `chore` | Maintenance tasks |
27+
28+
### GitHub CLI Commands
29+
30+
```bash
31+
gh issue list # List open issues
32+
gh issue view <number> # View details
33+
gh issue create --title "type(scope): description" --body "..."
34+
gh issue close <number>
35+
```
36+
37+
## Commands
38+
39+
```bash
40+
npm run dev # Start dev server at localhost:4321
41+
npm run build # Build production site to ./dist/
42+
npm run preview # Preview production build locally
43+
npm run new # Create a new blog post (interactive prompts)
44+
```
45+
46+
## Architecture
47+
48+
This is an Astro static site for Calvin Allen's personal blog, deployed to Cloudflare Pages.
49+
50+
### Content System
51+
52+
- Blog posts are markdown files in `src/content/blog/{year}/{slug}/index.md`
53+
- Each post lives in its own directory to colocate images (e.g., `cover.png`)
54+
- Schema defined in `src/content/config.ts` with Zod validation:
55+
- Required: `title`, `date`, `categories` (array)
56+
- Optional: `description`, `image`, `youtube`
57+
58+
### Post Frontmatter Example
59+
60+
```yaml
61+
---
62+
title: "Post Title"
63+
date: "2025-12-25T21:58:58-05:00"
64+
categories: [dotnet, csharp]
65+
description: "Optional description"
66+
image: ./cover.png
67+
---
68+
```
69+
70+
### Date Handling
71+
72+
Dates include timezone offset in frontmatter. Display formatting uses `timeZone: 'America/New_York'` to ensure dates render correctly regardless of build server timezone.
73+
74+
### Key Files
75+
76+
- `src/pages/[...slug].astro` - Dynamic post routes
77+
- `src/pages/rss.xml.ts` - RSS feed generation
78+
- `src/layouts/PostLayout.astro` - Individual post layout
79+
- `src/components/PostCard.astro` - Blog listing card component
80+
- `scripts/new-post.js` - Interactive post creation script

README.md

Lines changed: 47 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,60 @@
1-
# Astro Starter Kit: Minimal
1+
# 👨‍💻 Coding With Calvin
22

3-
```sh
4-
npm create astro@latest -- --template minimal
5-
```
3+
Personal blog of Calvin Allen — software development thoughts, tutorials, and experiences.
64

7-
> 🧑‍🚀 **Seasoned astronaut?** Delete this file. Have fun!
5+
🌐 **Live at:** [codingwithcalvin.net](https://www.codingwithcalvin.net)
86

9-
## 🚀 Project Structure
7+
## ✨ Features
108

11-
Inside of your Astro project, you'll see the following folders and files:
9+
- 📝 Markdown-based blog posts with frontmatter
10+
- 🏷️ Category tagging and filtering
11+
- 📰 RSS feed for subscribers
12+
- 🎨 Dark theme with custom styling
13+
- 📱 Fully responsive design
14+
- ⚡ Lightning-fast static site generation
15+
- ☁️ Deployed on Cloudflare Pages
1216

13-
```text
14-
/
15-
├── public/
16-
├── src/
17-
│ └── pages/
18-
│ └── index.astro
19-
└── package.json
20-
```
17+
## 🛠️ Tech Stack
18+
19+
- [Astro](https://astro.build) - Static site generator
20+
- [Tailwind CSS](https://tailwindcss.com) - Styling
21+
- [TypeScript](https://typescriptlang.org) - Type safety
2122

22-
Astro looks for `.astro` or `.md` files in the `src/pages/` directory. Each page is exposed as a route based on its file name.
23+
## 🚀 Quick Start
2324

24-
There's nothing special about `src/components/`, but that's where we like to put any Astro/React/Vue/Svelte/Preact components.
25+
```bash
26+
# Install dependencies
27+
npm install
2528

26-
Any static assets, like images, can be placed in the `public/` directory.
29+
# Start dev server
30+
npm run dev
2731

28-
## 🧞 Commands
32+
# Build for production
33+
npm run build
2934

30-
All commands are run from the root of the project, from a terminal:
35+
# Preview production build
36+
npm run preview
37+
```
38+
39+
## 📄 Creating a New Post
3140

32-
| Command | Action |
33-
| :------------------------ | :----------------------------------------------- |
34-
| `npm install` | Installs dependencies |
35-
| `npm run dev` | Starts local dev server at `localhost:4321` |
36-
| `npm run build` | Build your production site to `./dist/` |
37-
| `npm run preview` | Preview your build locally, before deploying |
38-
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
39-
| `npm run astro -- --help` | Get help using the Astro CLI |
41+
```bash
42+
npm run new-post "Your Post Title Here"
43+
```
44+
45+
This creates a new markdown file in `src/content/blog/` with the current date and frontmatter template.
46+
47+
## 📁 Project Structure
48+
49+
```
50+
src/
51+
├── components/ # Reusable Astro components
52+
├── content/blog/ # Markdown blog posts
53+
├── layouts/ # Page layouts
54+
├── pages/ # Routes and pages
55+
└── styles/ # Global styles
56+
```
4057

41-
## 👀 Want to learn more?
58+
## 📜 License
4259

43-
Feel free to check [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat).
60+
Content © Calvin Allen. Code is MIT licensed.

src/components/PostCard.astro

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ const { title, slug, date, description, categories, image } = Astro.props;
1616
const formattedDate = date.toLocaleDateString('en-US', {
1717
year: 'numeric',
1818
month: 'long',
19-
day: 'numeric'
19+
day: 'numeric',
20+
timeZone: 'America/New_York'
2021
});
2122
---
2223

src/layouts/PostLayout.astro

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ const { title, slug, date, categories, description, image, youtube } = Astro.pro
2020
const formattedDate = date.toLocaleDateString('en-US', {
2121
year: 'numeric',
2222
month: 'long',
23-
day: 'numeric'
23+
day: 'numeric',
24+
timeZone: 'America/New_York'
2425
});
2526
2627
const postUrl = `https://www.codingwithcalvin.net/${slug}/`;

0 commit comments

Comments
 (0)