CLAUDE.md

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Repository Overview

This is a Jekyll-based GitHub Pages blog for tiankonguse (天空的代码世界), a Chinese technical blog covering algorithms, programming, investing, health, and life reflections.

Development Commands

Local Development Server

Start the Jekyll server with development configuration:

sudo jekyll serve --watch --config _config.yml,_config_dev.yml,_config_dev2.yml

Then access at:

Build (without server)

jekyll build --config _config.yml

Draft Workflow

Drafts are stored in /draft/ (not _drafts/). To publish a draft:

# Move draft to posts with proper date prefix
mv draft/filename.md _posts/2026/03/2026-03-04-filename.md

Architecture

Configuration Hierarchy

Configurations are merged left-to-right: _config.yml,_config_dev.yml,_config_dev2.yml

Directory Structure

Directory Purpose
_posts/ Blog posts organized by year/month (e.g., _posts/2026/01/)
_layouts/ HTML templates (default.html, post.html, page.html)
_includes/ Reusable components (nav.md, sidenav.md, tags_list.md)
_data/ YAML data files (link.yml, nav.yml, book.yml, toppost.yml)
_plugin/ Ruby plugins for sitemap, categories, tags
draft/ Draft posts (manually managed, outside Jekyll’s _drafts)
javascripts/, stylesheets/, images/ Static assets

Post Structure

Front matter template:

---
layout: post
title: "Post Title"
description: "Brief description"
categories: [category1, category2]
tags: [tag1, tag2]
keywords: [keyword1, keyword2]
date: YYYY-MM-DD HH:MM:SS +0800
---

The site uses permalink: /blog/:year/:month/:day/:title.html format.

Key Plugins (in _plugin/)

Data References

The site uses site.data extensively for reusable content:

Layout Hierarchy

default.html (base HTML structure)
├── post.html (blog posts, includes sidenav.md)
└── page.html (static pages)

Includes used in layouts:

Styling

Important Configuration Notes

  1. Timezone: Set to Asia/Shanghai for correct post dates
  2. Pagination: 10 posts per page via paginate: 10
  3. Markdown: kramdown with rouge highlighter
  4. Plugins used: jemoji, jekyll-redirect-from, jekyll-sitemap
  5. Port: Configured to port 80 (requires sudo)
  6. Keep files: /javascripts/, /stylesheets/, /images/ are preserved during build

关注公众号,接收最新消息

tiankonguse +
穿越