Claude Code Guide

This document provides guidance for working with this Jekyll blog repository using Claude Code.

Project Overview

This is a Jekyll-based static site for dkrichards.com, built with:

Common Tasks

Starting Development

bundle exec jekyll serve

The site runs at http://localhost:4000 with auto-regeneration enabled.

Creating a New Blog Post

  1. Create a file in _posts/ with format: YYYY-MM-DD-title-slug.md
  2. Add front matter:
    ---
    layout: post
    title: "Post Title"
    date: YYYY-MM-DD HH:MM:SS -0500
    categories: [category1, category2]
    ---
    
  3. Write content in Markdown
  4. Preview at http://localhost:4000

Running Linters

npm run lint              # All linters
npm run lint:markdown     # Markdown only
npm run lint:html         # HTML only
npm run lint:yaml         # YAML only

Project Structure

.
├── _config.yml           # Jekyll configuration
├── _includes/            # Reusable components
├── _layouts/             # Page templates
├── _posts/               # Blog posts (YYYY-MM-DD-title.md)
├── _drafts/              # Unpublished drafts
├── _sass/                # Sass stylesheets
├── assets/               # Images, CSS, JS
├── index.html            # Homepage
├── 404.html              # Error page
└── vendor/bundle/        # Ruby gems (git-ignored)

Key Configuration

Jekyll Config (_config.yml)

Linter Configs

Dependencies

Ruby (via rbenv)

bundle install            # Install gems
bundle update             # Update gems
bundle exec jekyll ...    # Run Jekyll commands

Node.js (for linters)

npm install               # Install packages
npm update                # Update packages

Git Workflow

Ignored Files

Deployment

Changes pushed to master branch auto-deploy to GitHub Pages.

Helpful Commands

Jekyll

# Build site
bundle exec jekyll build

# Serve with drafts
bundle exec jekyll serve --drafts

# Serve on specific port
bundle exec jekyll serve --port 4001

# Build for production
JEKYLL_ENV=production bundle exec jekyll build

Content Management

# Find all posts
ls -l _posts/

# Search post content
grep -r "search term" _posts/

# Count posts
ls -1 _posts/*.md | wc -l

Common Issues

Ruby Version Mismatch

Ensure rbenv is initialized in your shell:

eval "$(rbenv init - zsh)"

Or add to ~/.zshrc:

command -v rbenv 1>/dev/null 2>&1 && eval "$(rbenv init - zsh)"

Bundle Install Fails

Set local bundle path:

bundle config set --local path 'vendor/bundle'
bundle install

Jekyll Server Not Updating

Clear cache and restart:

bundle exec jekyll clean
bundle exec jekyll serve

Writing Tips

Front Matter Variables

Markdown Features

Draft Posts

  1. Create in _drafts/ (no date in filename)
  2. Preview with --drafts flag
  3. Move to _posts/ with date when ready to publish

SEO & Metadata

The site uses jekyll-seo-tag plugin:

Performance Notes

Claude Code Workflows

Suggested Prompts

Best Practices

  1. Run linters before committing
  2. Test locally before pushing
  3. Check responsive design
  4. Validate YAML front matter
  5. Preview posts with --drafts first

Resources