Skip to content

Commit ed556bc

Browse files
tmr08cclaude
andcommitted
docs: improve CLAUDE.md with comprehensive development guide
- Add detailed development commands including bin scripts - Expand architecture section with Hugo configuration details - Add git submodule management instructions - Include blog post structure guidelines and testing strategy - Document deployment pipeline details 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent edd10f5 commit ed556bc

File tree

1 file changed

+71
-43
lines changed

1 file changed

+71
-43
lines changed

CLAUDE.md

Lines changed: 71 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -10,69 +10,97 @@ This is a personal blog built with Hugo (Go static site generator) using the hug
1010

1111
### Development
1212
```bash
13-
cd hugo-site # Navigate to Hugo site directory
14-
hugo server # Start development server at localhost:1313
15-
hugo # Build production site
13+
cd hugo-site # Navigate to Hugo site directory
14+
./bin/dev # Start development server with drafts at localhost:1313
15+
./bin/server # Start production-like server at localhost:1313
16+
hugo server # Basic Hugo server
17+
hugo # Build production site to public/ directory
1618
```
1719

18-
### Code Quality
20+
### Testing
1921
```bash
20-
# Content is primarily markdown files
22+
cd hugo-site # Navigate to Hugo site directory
23+
npm install # Install test dependencies (first time only)
24+
npm run test:e2e # Run E2E tests with interactive Cypress UI
25+
npm run test:e2e:ci # Run E2E tests in headless CI mode
26+
npm run cy:open # Open Cypress test runner directly
2127
```
2228

23-
### Testing
29+
### Content Creation
2430
```bash
25-
cd hugo-site # Navigate to Hugo site directory
26-
npm run cy:open # Open Cypress test runner
27-
npm run test:e2e # Run E2E tests with dev server
28-
npm run test:e2e:ci # Run E2E tests in CI mode
31+
cd hugo-site
32+
hugo new blog/YYYY/MM/post-title/index.md # Create new blog post with archetype
33+
hugo list drafts # List all draft content
34+
hugo list future # List future-dated content
2935
```
3036

3137
### Deployment
3238
```bash
3339
# Automatic deployment via GitHub Actions when pushing to main branch
3440
# Manual deployment can be triggered from GitHub Actions tab
41+
# Site deploys to: https://tmr08c.github.io/
3542
```
3643

3744
## Architecture
3845

39-
### Content Structure
40-
- Blog posts are markdown files in `hugo-site/content/blog/` organized by year/month
41-
- Static assets go in `hugo-site/static/`
42-
- Hugo configuration in `hugo-site/hugo.toml`
43-
- Theme files in `hugo-site/themes/hugo-texify3/`
46+
### Content Organization
47+
- **Blog posts**: `hugo-site/content/blog/YYYY/MM/post-name/index.md` with co-located assets
48+
- **Static files**: `hugo-site/static/` for site-wide assets (favicon, etc.)
49+
- **Theme assets**: `hugo-site/themes/hugo-texify3/` (git submodule from GitHub)
50+
- **Custom layouts**: `hugo-site/layouts/` for overriding theme templates
51+
52+
### Hugo Configuration Highlights
53+
- **Permalinks**: Posts use `/:year/:month/:slug/` format
54+
- **Outputs**: Generates both HTML and RSS feeds
55+
- **Markup**: Goldmark renderer with syntax highlighting enabled
56+
- **Navigation**: Main menu includes Blog, RSS, and GitHub links
57+
- **Theme features**: Table of contents, social sharing, custom CSS/JS support
58+
59+
### Development Workflow
60+
- Use `./bin/dev` for development (includes drafts and future posts)
61+
- Content is primarily markdown with YAML frontmatter
62+
- Hugo rebuilds automatically on file changes during development
63+
- Cypress tests verify site functionality after builds
4464

4565
### Key Technologies
4666
- **Static Site Generator**: Hugo (Go-based)
4767
- **Theme**: hugo-texify3 (git submodule)
48-
- **Styling**: PostCSS with theme-provided CSS
49-
- **Code highlighting**: Hugo's built-in syntax highlighting
50-
- **Testing**: Cypress for E2E tests
51-
- **Deployment**: GitHub Actions to GitHub Pages
52-
53-
### Important Files
54-
- `hugo-site/hugo.toml` - Main Hugo configuration
55-
- `hugo-site/layouts/` - Custom layout templates (if any)
56-
- `hugo-site/content/` - All content including blog posts
57-
- `hugo-site/static/` - Static assets (images, files)
58-
- `hugo-site/themes/hugo-texify3/` - Theme files (git submodule)
59-
60-
## Branching Strategy
68+
- **Styling**: PostCSS pipeline + theme SCSS
69+
- **Testing**: Cypress E2E tests with start-server-and-test
70+
- **Deployment**: GitHub Actions → GitHub Pages
71+
- **Content**: Markdown with YAML frontmatter
6172

62-
- **main** - Main development and deployment branch
63-
- **master** - Legacy branch (GitHub Pages publishes from main now)
64-
- Work on `main`, GitHub Actions automatically deploys to GitHub Pages
73+
## Important Implementation Details
6574

66-
## Testing
67-
68-
E2E tests are in `hugo-site/cypress/e2e/` and cover:
69-
- Homepage navigation and content
70-
- Blog post listing and navigation
71-
- Site functionality
72-
73-
## Deployment
75+
### Git Submodule Management
76+
The hugo-texify3 theme is managed as a git submodule. When cloning or updating:
77+
```bash
78+
git submodule update --init --recursive # Initialize submodules
79+
git submodule update --remote # Update theme to latest
80+
```
7481

75-
Site deploys to GitHub Pages via GitHub Actions. The deployment process:
76-
1. Builds the Hugo site when code is pushed to `main`
77-
2. Automatically deploys to GitHub Pages
78-
3. Can also be triggered manually from the GitHub Actions tab
82+
### Blog Post Structure
83+
New posts should follow the established pattern:
84+
- Location: `hugo-site/content/blog/YYYY/MM/descriptive-title/index.md`
85+
- Co-locate images and assets in the same directory as `index.md`
86+
- Use YAML frontmatter with title, date, and optional tags
87+
88+
### Custom Bin Scripts
89+
The `hugo-site/bin/` directory contains convenience scripts:
90+
- `./bin/dev` - Development server with drafts and future content enabled
91+
- `./bin/server` - Production-like server without drafts
92+
- `./bin/build` - Production build script
93+
- `./bin/setup` - Initial setup script
94+
95+
### Testing Strategy
96+
- E2E tests in `hugo-site/cypress/e2e/` verify core site functionality
97+
- Tests run against Hugo server on port 8000 (not default 1313)
98+
- CI runs tests in headless mode, development uses interactive mode
99+
100+
## Deployment Pipeline
101+
102+
Site deploys automatically via GitHub Actions:
103+
1. **Trigger**: Push to `main` branch or manual workflow dispatch
104+
2. **Build**: Hugo generates static site with production optimizations
105+
3. **Deploy**: GitHub Pages publishes to https://tmr08c.github.io/
106+
4. **Dependencies**: Uses Hugo version specified in `hugo-site/.tool-versions`

0 commit comments

Comments
 (0)