brajeshwar.com 2025

Todo

Option 1: Manual Build Process (Simplest)

Installation

# Global installation
npm install -g pagefind

# Or local to project
npm install pagefind --save-dev

Development Workflow

# 1. Build Jekyll site
bundle exec jekyll build

# 2. Generate Pagefind index
npx pagefind --site _site

# 3. Serve the site
bundle exec jekyll serve

Pros/Cons

Option 2: Jekyll Plugin/Hook (More Automated)

Steps

  1. Create Jekyll plugin in _plugins/pagefind.rb
  2. Hook into Jekyll’s build process
  3. Auto-run Pagefind after site generation
  4. Configure to only run in development mode

Development Workflow

# Single command - plugin handles Pagefind automatically
bundle exec jekyll serve

Pros/Cons

Option 3: Watch Script (Most Convenient)

Setup

  1. Create watch script using nodemon or similar
  2. Monitor Jekyll source files for changes
  3. Auto-rebuild Jekyll + Pagefind on changes
  4. Restart Jekyll server automatically

Example Implementation

# Install file watcher
npm install -g nodemon

# Create watch script
nodemon --watch _posts --watch _pages --exec "bundle exec jekyll build && npx pagefind --site _site"

Pros/Cons

Option 4: Docker/Make Setup

Setup

  1. Create Dockerfile with Jekyll + Node + Pagefind
  2. Create Makefile with development commands
  3. Single command to start full environment

Example Commands

# Start development environment
make dev

# Build and test
make build

Pros/Cons

Recommendation

For Immediate Testing

Start with Option 1 (Manual) - simple and works right away.

For Regular Development

Move to Option 3 (Watch Script) - best developer experience with automatic rebuilds.

For Team Development

Consider Option 4 (Docker) - consistent environment for all developers.

Implementation Priority

  1. Phase 1: Manual process for testing
  2. Phase 2: Watch script for regular development
  3. Phase 3: Consider Jekyll plugin if watch script isn’t sufficient

Notes

Current Files