Skip to content

Commit 148942e

Browse files
calderbuildclaude
andcommitted
docs: streamline CLAUDE.md + SEO optimization
- CLAUDE.md: simplified from 220 to 100 lines, added troubleshooting - SEO: optimized title (77->32 chars), meta description (210->143 chars) - Extended hreflang to homepage and about page - Added editorial-design.less module for enhanced styling 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent df044a3 commit 148942e

File tree

9 files changed

+2403
-187
lines changed

9 files changed

+2403
-187
lines changed

CLAUDE.md

Lines changed: 59 additions & 180 deletions
Original file line numberDiff line numberDiff line change
@@ -4,122 +4,40 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
44

55
## Project Overview
66

7-
Jason's personal technical blog built with Jekyll, focusing on AI development, Agent applications, full-stack development, and hackathon projects. The site features modern responsive design with PWA support and tech-enhanced styling.
7+
Jekyll-based technical blog with PWA support, dark mode, and bilingual content (English/Chinese). Live at https://jasonrobert.me.
88

99
## Development Commands
1010

11-
### Prerequisites
12-
- Ruby 2.7+ (production uses Ruby 3.1)
13-
- Less compiler (standalone, no Node.js required)
14-
- Git
15-
- On Windows: Use PowerShell or WSL for running bash scripts
16-
17-
### Build & Development Workflow
18-
1911
```bash
20-
# 1. Install Ruby dependencies
12+
# Install dependencies
2113
bundle install
2214

23-
# 2. Compile Less to CSS (REQUIRED before serving/deploying)
15+
# Compile Less to CSS (REQUIRED before any commit with CSS changes)
2416
./build.sh
25-
# On Windows PowerShell: bash build.sh
17+
# Windows: bash build.sh
2618

27-
# 3. Start local development server
19+
# Local development
2820
bundle exec jekyll serve
2921

30-
# 4. Build for production
22+
# Production build
3123
bundle exec jekyll build
32-
33-
# 5. Clean generated files
34-
bundle exec jekyll clean
3524
```
3625

37-
### Critical Build Rule
26+
## Critical Rules
3827

39-
**⚠️ ALWAYS compile Less files before deployment:**
40-
- The GitHub Actions workflow does NOT compile Less files
41-
- You MUST run `./build.sh` locally before committing CSS changes
42-
- Never edit files in `/css` directory directly - edit `/less` files instead
43-
- On Windows, run the build script via: `bash build.sh` or use WSL
28+
### CSS/Less Workflow
29+
1. **NEVER edit `/css` files directly** - edit `/less` files instead
30+
2. **ALWAYS run `./build.sh` before committing CSS changes** - GitHub Actions does NOT compile Less
31+
3. Entry point: `less/jason-blog.less` imports all modules
32+
4. Output: `css/jason-blog.css` (dev) + `css/jason-blog.min.css` (prod)
4433

45-
### Deployment
34+
### Frontend Development
35+
**Invoke `Skill(frontend-design)` before any UI/CSS work** - this ensures design quality and avoids generic AI aesthetics.
4636

47-
Automatic deployment via GitHub Actions on push to `master` branch:
48-
- Workflow: `.github/workflows/jekyll.yml`
49-
- Ruby 3.1, Bundler cache enabled
50-
- Deploys to GitHub Pages automatically
51-
- Does NOT compile Less files (must be done locally)
52-
53-
## Architecture
37+
### Blog Posts
38+
Posts must follow naming: `_posts/YYYY-MM-DD-title.md`
5439

55-
### Technology Stack
56-
- **Jekyll**: Static site generator with Liquid templating
57-
- **Bootstrap 3**: Customized responsive framework
58-
- **Less**: CSS preprocessor (no Node.js build system)
59-
- **jQuery**: Client-side interactions and PWA support
60-
61-
### Directory Structure
62-
63-
```
64-
├── _posts/ # Blog posts (YYYY-MM-DD-title.md format)
65-
├── _layouts/ # Page templates (default, post, page, keynote)
66-
├── _includes/ # Reusable components (nav, footer, head, etc.)
67-
├── less/ # Less source files (EDIT HERE)
68-
│ ├── jason-blog.less # Main entry point
69-
│ ├── variables.less # Design tokens, colors
70-
│ ├── tech-enhancements.less # Modern UI components
71-
│ └── dark-mode.less # Dark mode styles
72-
├── css/ # Compiled CSS (DO NOT EDIT)
73-
├── js/ # JavaScript files
74-
│ ├── jason-blog.js # Custom scripts
75-
│ └── sw-registration.js # PWA service worker
76-
└── _config.yml # Jekyll configuration
77-
```
78-
79-
### Less Build System
80-
81-
**Build Flow:**
82-
1. Edit files in `/less` directory
83-
2. Run `./build.sh` to compile
84-
3. Generates both `css/jason-blog.css` (dev) and `css/jason-blog.min.css` (production)
85-
4. Commit compiled CSS files to git
86-
87-
**Less File Organization:**
88-
- `jason-blog.less`: Main entry point, imports all modules in order
89-
- `variables.less`: Base colors, fonts, spacing tokens
90-
- `design-tokens.less`: Extended design system tokens
91-
- `mixins.less`: Reusable Less mixins and utilities
92-
- `tech-enhancements.less`: Gradients, animations, modern UI components
93-
- `dark-mode.less`: Dark mode theme (CSS custom properties)
94-
- `accessibility.less`: A11y enhancements and ARIA support
95-
- `sidebar.less`, `side-catalog.less`: Sidebar and table of contents
96-
- `search.less`: Search UI components
97-
- `highlight.less`: Code syntax highlighting (Rouge)
98-
- `home-enhancements.less`: Homepage-specific styles
99-
- `article-enhancements.less`: Blog post page enhancements
100-
- `archive-enhancements.less`: Archive/tags page styles
101-
- `scroll-enhancements.less`: Scroll animations and effects
102-
- `interactive-components.less`: Buttons, modals, interactive elements
103-
- `snackbar.less`: Toast notification system
104-
- `multilingual.less`: Bilingual content support
105-
- `mobile-performance.less`: Mobile optimizations
106-
107-
### Frontend Features
108-
- **Responsive navigation** with scroll effects and Material Design animations
109-
- **Simple Jekyll Search** integration (`simple-jason-search.min.js`)
110-
- **Rouge syntax highlighting** with custom theme (`highlight.less`)
111-
- **MathJax support** (configurable per post via front matter)
112-
- **Progressive Web App**: manifest (`pwa/manifest.json`) + service worker (`sw.js`)
113-
- **Dark mode toggle** using CSS custom properties (`dark-mode.js`, `dark-mode.less`)
114-
- **Tech-themed gradients** and animations
115-
- **Accessibility features**: ARIA labels, keyboard navigation, reduced motion support
116-
- **Social sharing** integration (`social-share.js`)
117-
- **Image optimization** with lazy loading (`image-optimization.js`)
118-
- **Article interactions**: reading progress, smooth scroll (`article-interactions.js`)
119-
120-
### Blog Post Format
121-
122-
Front Matter structure:
40+
Front matter template:
12341
```yaml
12442
---
12543
layout: post
@@ -129,92 +47,53 @@ description: "SEO description"
12947
date: YYYY-MM-DD HH:MM:SS
13048
author: "Jason Robert"
13149
header-img: "img/path/to/header.jpg"
132-
catalog: true # Enable table of contents
50+
catalog: true # Table of contents
13351
tags:
13452
- Tag1
135-
- Tag2
13653
---
13754
```
13855

56+
## Architecture
57+
58+
### Key Directories
59+
- `less/` - Less source files (edit here for styles)
60+
- `variables.less` - Design tokens, colors, breakpoints
61+
- `dark-mode.less` - Dark theme (CSS custom properties)
62+
- `_layouts/` - Page templates (default, post, page, keynote)
63+
- `_includes/` - Reusable components (nav, footer, head)
64+
- `js/` - Client scripts (dark-mode.js, search, PWA registration)
65+
66+
### Less Module Structure
67+
`jason-blog.less` imports in order: variables -> design-tokens -> mixins -> component modules.
68+
69+
Key modules for common tasks:
70+
- Typography/colors: `variables.less`, `design-tokens.less`
71+
- Dark mode: `dark-mode.less` (uses CSS custom properties)
72+
- Syntax highlighting: `highlight.less`
73+
- Responsive: breakpoints in `variables.less` (768/992/1200px)
74+
75+
### Deployment
76+
- Push to `master` triggers GitHub Actions deployment
77+
- Workflow: `.github/workflows/jekyll.yml`
78+
- Ruby 3.1, auto-deploys to GitHub Pages
79+
80+
## Common Issues
81+
82+
### Styles not updating after deploy
83+
You forgot to run `./build.sh` before commit. The compiled CSS files must be committed.
84+
85+
### Jekyll serve fails
86+
Run `bundle install` first. Check Ruby version (needs 2.7+, prod uses 3.1).
87+
88+
### Dark mode not working
89+
Check `js/dark-mode.js` and `less/dark-mode.less`. Uses CSS custom properties toggled via JavaScript.
90+
91+
### Build script fails on Windows
92+
Use WSL or Git Bash: `bash build.sh`
93+
13994
## Configuration
14095

141-
### Jekyll (_config.yml)
142-
- Site metadata and SEO settings
143-
- Social media links (GitHub, CSDN, Juejin, Bilibili, ModelScope)
144-
- Pagination: 10 posts per page
145-
- Markdown: Kramdown with GFM (GitHub Flavored Markdown)
146-
- Syntax highlighting: Rouge
147-
- Future posts: enabled (`future: true`)
148-
149-
### PWA Configuration
150-
- Manifest: `pwa/manifest.json`
151-
- Service Worker: `sw.js` (caches pages, CSS, JS)
152-
- Registration: `js/sw-registration.js`
153-
- Theme color: `#000000` (black)
154-
155-
### SEO & Analytics
96+
- Site config: `_config.yml` (SEO, social links, pagination)
97+
- PWA manifest: `pwa/manifest.json`
98+
- Service worker: `sw.js`
15699
- Google Analytics: `ga_track_id` in `_config.yml`
157-
- Disqus comments: `disqus_username` in `_config.yml`
158-
- Sitemap: `sitemap.xml` (manual, not auto-generated)
159-
- Robots: `robots.txt` (allows all)
160-
161-
## Key Implementation Details
162-
163-
### Less Compilation Script (`build.sh`)
164-
- Compiles `less/jason-blog.less` to two outputs:
165-
- `css/jason-blog.css`: Uncompressed (development)
166-
- `css/jason-blog.min.css`: Minified with aggressive optimization (`--clean-css="--s1 --advanced --compatibility=ie8"`)
167-
- Displays minified file size after build
168-
169-
### Responsive Design Breakpoints
170-
Defined in `variables.less`:
171-
- Mobile: < 768px
172-
- Tablet: 768px - 992px
173-
- Desktop: 992px - 1200px
174-
- Large: > 1200px
175-
176-
### Color System
177-
Uses CSS custom properties for theming:
178-
- Light mode: default (black text on white)
179-
- Dark mode: toggled via JavaScript, uses inverted palette
180-
- Accent colors: tech-themed gradients (blue/purple spectrum)
181-
182-
### Performance Optimizations
183-
- Minified CSS and JavaScript
184-
- Service worker caching strategy
185-
- Lazy-loaded images (native loading="lazy")
186-
- Preconnect to external fonts/resources
187-
- Bundled critical CSS inline in `<head>`
188-
189-
## Git Workflow
190-
191-
### Ignored Files (`.gitignore`)
192-
- Build artifacts: `_site/`, `.jekyll-cache/`
193-
- Drafts: `_posts/_draft/`, `_posts/_archive/`
194-
- System files: `.DS_Store`, `Thumbs.db`
195-
- Logs: `*.log`, `*.lock`
196-
- Temporary files: `*.tmp`, `*.temp`, `*.bak`, `*.swp`
197-
- Scripts: `*.sh`, `start.sh` (but committed CSS files are tracked)
198-
- Documentation workspace: `document/`
199-
200-
### Branch Strategy
201-
- Main branch: `master`
202-
- Direct push to `master` triggers deployment via GitHub Actions
203-
- Use feature branches for major changes
204-
205-
### Key File Locations
206-
- **Layouts**: `_layouts/` (default.html, post.html, page.html, keynote.html)
207-
- **Reusable components**: `_includes/` (nav.html, footer.html, head.html, etc.)
208-
- **Blog posts**: `_posts/` (must follow `YYYY-MM-DD-title.md` naming)
209-
- **Custom JavaScript**: `js/jason-blog.js` (main custom scripts)
210-
- **Service Worker**: `sw.js` (root level, caches static assets)
211-
- **Search data**: `search.json` (auto-generated from posts for client-side search)
212-
213-
## Important Notes
214-
215-
- **CSS Workflow**: Never skip Less compilation - GitHub Actions won't compile it
216-
- **Content**: Supports bilingual posts (English/Chinese)
217-
- **Images**: Place in `/img` directory, use absolute paths in posts
218-
- **JavaScript**: Minimal custom JS, primarily for PWA, search, and theme toggle
219-
- **Design Philosophy**: Tech-themed modern aesthetic with accessibility focus
220-
- **No package.json**: Uses standalone Less compiler, not npm build tools

_config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Site settings
22
title: Jason's Blog
3-
SEOTitle: Jason's Blog | AI Agent Development & Multi-Agent Architecture
3+
SEOTitle: AI Agent Dev Expert | Jason Robert
44
header-img: img/home-bg-o.jpg
55
email: johnrobertdestiny@gmail.com
6-
description: "AI Agent development expert with 28 months production experience. Multi-agent architecture, hackathon-winning projects, real case studies."
6+
description: "AI Agent developer with 28 months production experience. Award-winning projects: MeetSpot, L'Oreal Data Assistant. Weekly AI insights."
77
keyword: "AI Agent, Core Web Vitals, PageSpeed, Devtools MCP, 多智能体, 性能优化"
88
url: "https://jasonrobert.me" # your host, for absolute URL
99
baseurl: "" # for example, '/blog' if your blog hosted on 'host/blog'

_includes/footer.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
Copyright &copy; {{ site.title }} {{ site.time | date: '%Y' }}
1111
<br>
1212
Powered by Jason's Tech Stack |
13-
<a href="{{ "/feed.xml" | prepend: site.baseurl }}">RSS</a>
13+
<a href="{{ "/feed.xml" | prepend: site.baseurl }}" title="Subscribe via RSS feed">RSS</a>
1414
</p>
1515
</div>
1616
</div>

_includes/head.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
<link rel="canonical" href="{% if page.canonical %}{{ page.canonical }}{% elsif page.url == '/' %}{{ site.url }}/{% else %}{{ site.url }}{{ page.url | replace:'index.html','' }}{% endif %}">
9898

9999
<!-- Hreflang Tags for Bilingual SEO -->
100-
{% if page.multilingual %}
100+
{% if page.multilingual or page.url == '/' or page.url == '/index.html' or page.url == '/about/' %}
101101
<link rel="alternate" hreflang="en" href="{{ site.url }}{{ page.url | replace:'index.html','' }}" />
102102
<link rel="alternate" hreflang="zh" href="{{ site.url }}{{ page.url | replace:'index.html','' }}" />
103103
<link rel="alternate" hreflang="zh-CN" href="{{ site.url }}{{ page.url | replace:'index.html','' }}" />

0 commit comments

Comments
 (0)