CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Overview
This is a Jekyll-based personal blog hosted on GitHub Pages. The site uses Jekyll Now theme with custom modifications for a personal tech blog featuring programming tutorials, algorithm solutions, and technical notes in both English and Chinese.
Site Structure
_posts/: Blog posts organized by categoryCoding/: Programming tutorials (Python, JS-HTML-CSS, Ai subcategories)Learning/: Course summaries, book reviews, and study notes (Reading, Review, RWTH subdirectories)Handbook/: Quick reference guides and cheat sheets
_layouts/: Jekyll page templates (default.html, post.html, page.html)_includes/: Reusable template components (analytics, disqus, meta tags, svg-icons)_sass/: SCSS stylesheets for custom stylingassets/: Static assets including PDFs, search functionality (Tipue Search), and imagesbootstrap/: Bootstrap 3.3.7 CSS/JS framework and custom directory functionalityimages/: Site images and favicon
Key Features
- Search functionality: Tipue Search integration for client-side full-text search
- Multilingual content: Posts in both English and Chinese
- Mermaid diagrams: Conditional async loading for diagram rendering
- Pagination: Blog post pagination (5 posts per page)
- Comments: Disqus integration (shortname:
ruiming-huangs-blog) - Analytics: Google Analytics tracking (UA-96728449-1)
- Directory page: Custom JavaScript-based directory/index view with collapsible tree structure
- Bootstrap integration: Responsive design with Bootstrap 3.3.7 and jQuery 3.7.1
Development Workflow
This site uses GitHub Pages’ automatic Jekyll processing with no local build system:
- Deployment: Automatic on push to
masterbranch via GitHub Pages - Local development: Run
jekyll serveif Jekyll is installed locally (no Gemfile present, manual setup required) - Testing changes: Edit files directly and push to trigger GitHub Pages build
- Dependencies: All frontend libraries vendored locally except Mermaid.js (loaded from CDN when needed)
Jekyll Configuration
Key settings in _config.yml:
- Uses Kramdown with GitHub Flavored Markdown (GFM)
- Rouge syntax highlighter with Pygments CSS class
- Jekyll plugins:
jekyll-paginate,jekyll-sitemap,jekyll-feed - Page permalink:
/:title/ - Posts collection permalink:
/posts/:path/ - Site URL:
https://wizna.github.io/
Custom Architecture Components
Dynamic Directory System
The directory page (/directory) dynamically generates a hierarchical view of all posts:
- Core logic: bootstrap/js/directory.js implements custom Tree data structure
- Tree construction:
getDirectoryStructure()(lines 50-73) parses.post-directelements from Jekyll’s post collection - Recursive rendering:
recurseTree()(lines 30-48) generates Bootstrap collapsible UI with proper nesting - Path parsing: Extracts directory structure from post permalinks, stripping date prefixes (
YYYY-MM-DD-) - Bootstrap collapse: Each category node uses Bootstrap’s
data-toggle="collapse"for expand/collapse functionality
Client-Side Search
Full-text search without server-side processing:
- Tipue Search: Indexes all post content via Jekyll Liquid templates
- Content generation: assets/tipuesearch/tipuesearch_content.js dynamically generated from Jekyll
site.posts - Modal interface: Search results display in Bootstrap modal (_layouts/default.html:75-85)
- Conditional loading: Search assets only load on pages with
tipue_search_active: truefront matter - Minimum query length: 3 characters required for search
Performance Optimizations
- Conditional Mermaid loading: _layouts/default.html:29-47 checks for
.language-mermaidor.mermaidclasses before loading Mermaid.js from CDN - Image preloading: WebP avatar preloaded for faster LCP (_layouts/default.html:16)
- Vendored dependencies: All core JS/CSS libraries served locally (Bootstrap, jQuery, Tipue Search)
- Async script loading: Mermaid.js loaded asynchronously with
script.async = true
Template Architecture
- Layout hierarchy:
default.html→post.htmlorpage.html - Multi-language support: Chinese/English content with consistent navigation structure
- Custom permalinks: Posts use
/posts/:path/to preserve category structure in URLs - Pagination: 5 posts per page with pagination navigation (
paginate_path: /page:num/)
Content Guidelines
- Post format: YAML front matter with
layoutspecification (usuallypost) - Filename convention:
YYYY-MM-DD-title.mdin appropriate_posts/subdirectory - Category structure: Determined by subdirectory path (e.g.,
_posts/Coding/Python/→/posts/Coding/Python/) - Code highlighting: Use triple backticks with language identifier (rendered via Rouge)
- Mermaid diagrams: Use
mermaidcode fence language identifier - Multilingual: Posts can be in English or Chinese; navigation and UI elements support both
- Search exclusion: Add
exclude_from_search: trueto front matter to exclude from Tipue Search index
